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 di开发者_StackOverflowfferent than the one previously displayed. How do I work around this?
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>
精彩评论