1

I have to use like operator for SQL Command in SQL Datasource, but it is not working. 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>
1
  • What exactly is not working? Commented Feb 23, 2017 at 21:24

2 Answers 2

4

Do this:

WHERE Name LIKE '%' + @nameparam + '%'"; 
Sign up to request clarification or add additional context in comments.

Comments

1
      where  Domain LIKE '%' + @DomainID + '%'" >

we need send this way in order to get the like operator work.Thanks

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.