【发布时间】:2016-02-20 04:58:30
【问题描述】:
我想在 Visual Studio 中使用 GridView。我浏览了他们的教程,我已经设置好了。但是我看不到如何使用我的存储过程。
它让我明白了:
<asp:SqlDataSource ID="SqlDataSourceViewRegistrants" runat="server"
ConnectionString="<%$ ConnectionStrings:Events2 %>"
SelectCommand="SELECT * FROM [Registrant]"></asp:SqlDataSource>
我想用存储过程替换 SelectCommand,如下所示:
sqlCmd.CommandType = System.Data.CommandType.StoredProcedure;
sqlCmd.CommandText = "spGetAllRegistrants";
我不知道把spGetAllRegistrants的这个信息放在哪里。
【问题讨论】:
标签: asp.net stored-procedures gridview