[英]Like operator in SQL Query in SQL Datasource
I have to use like operator for SQL Command in SQL Datasource, but it is not working. 我必须对SQL数据源中的SQL命令使用like运算符,但是它不起作用。 Did some one run into the issue? 有人遇到了这个问题吗? Please Advise. 请指教。
<asp:SqlDataSource ID="gridSource" runat="server" ConnectionString="<%$ ConnectionStrings:connectionString %>"
SelectCommand=" select * from [test where domain like '%@DomainID%'">
<SelectParameters>
<asp:ControlParameter Name="DomainID" PropertyName="SelectedValue" ControlID="ddlcu"></asp:ControlParameter>
</SelectParameters>
</asp:SqlDataSource>
做这个:
WHERE Name LIKE '%' + @nameparam + '%'";
where Domain LIKE '%' + @DomainID + '%'" >
我们需要以这种方式发送以便获得类似操作员的工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.