Get Column Names From List
Full Framework MVC 5 SQL Server 2017 ADO.NET
I have a method that calls a stored procedure, and with the data returned from the stored procedure returns a list.
Typically, I will return a list to the ActionResult, and use a foreach on the front end to populate the table data. All of the table headers are permanent, so they’re hard coded on the front end since It never changes, so I’ve never really had a need for dynamic table headers.
- Do lists not stored column info?
- Should I adjust the stored procedures to populate a table instead, then query INFORMATION_SCHEMA.COLUMNS to get the column names?
- Should I just switch the a different data type, such as DataTable?
Anyone have any suggestions on the best course of action?
0 comments:
Post a Comment