I have a gridview setup that gets its data from a SQL database stored procedure. This procedure will return one of several different tables. The gridview complains if the table is different than the one previously displayed. How do I work around this?
+1
A:
You can set the AutoGenerateColumns property of the GridView to true, so that whatever table you are binding to, the related columns and data will show.
<asp:GridView runat="server" ID="gridViewTest" AutoGenerateColumns="true" >
</asp:GridView>
Ed B
2010-06-16 14:40:28
After I enabled that I had to go in and remove all of the columns from the gridview, for some reason it was saving them and still producing the error. But after doing that it worked great.
Shawn
2010-06-16 15:29:21