If I query select * from a MS-SQL table and display only a few data columns (the rest of the columns are either non-visible or non-existent), does the query result sent to the GridView include all of the unused columns’s data or the GridView is sent only the data that are going to be displayed.if all the data is sent then whether only those data will be stored in ViewState or all data is stored
Thanks.
If I query select * from a MS-SQL table and display only a few
Share
Yes. All columns are available for the GridView for display. It now depends on if you want to show some or all. This is obvious when you set
AutoGenerateColumns="true"on your GridView.The GridView is a presentation object and abstract/extract the information in the underlying datasource e.g.
From the example above,
ProductNameandPriceare shown in the GridView but some other columns from your datasource are available e.g.ProductIDused forDataKeyNames