1

If GridView is bound to a SqlDataScource control, which has a select statement, GridView will produce an error if that select statement is later changed programmatically to select a different set of columns, the error is

'System.Data.DataRowView' does not contain a property with the name [An Expected Column Name]

How could one execute different select statements from time to time that return different columns and display their results in a GridView ?

Thanks

1
  • I've never done something like that but maybe you could check if the AutoGenerateColumns of the grid is set to true or before the binding, check if you have to add or remove elements from Grid.Columns
    – saul672
    Commented Aug 20, 2012 at 2:53

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.