开发者

Gridview display multiple tables?

开发者 https://www.devze.com 2023-01-03 12:06 出处:网络
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开发者_StackOverfl

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>
0

精彩评论

暂无评论...
验证码 换一张
取 消