需要从C#修改的SelectCommand参数的SqlDataSource [英] Need to modify the SelectCommand parameter for SqlDataSource from C#
本文介绍了需要从C#修改的SelectCommand参数的SqlDataSource的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有我试图从后面页我的code在C#ASP.NET修改一个SqlDataSource。在页面的code是:
I have a SqlDataSource that I am trying to modify in C# ASP.NET from my code behind page. The code in the page is:
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:TEST_SERVER %>"
ProviderName="<%$ ConnectionStrings:TEST_SERVER.ProviderName %>"
</asp:SqlDataSource>
我要动态地修改SqlDataSource1但在codebehind页它似乎没有可用SelectCommand中的参数。
I want to dynamically modify the SelectCommand parameter for SqlDataSource1 but in the codebehind page it does not seem to be available.
我是不是做错了?
推荐答案
SELECT命令将在那里只要你添加你的结局'>'到打开的标签。
The select command will be there as soon as you add your ending '>' to your open tag.
试试这个:
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:TEST_SERVER %>"
ProviderName="<%$ ConnectionStrings:TEST_SERVER.ProviderName %>">
</asp:SqlDataSource>
该死的错别字;)
Darn typos ;)
这篇关于需要从C#修改的SelectCommand参数的SqlDataSource的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文