locked
About add parameter in like statement (in access database- oledbconnection) RRS feed

  • Question

  • User-1122054360 posted

     Hi...I am a new bie in asp.net. Recently face a problem in add parameter in like statement.

    Have anyone could tell me, hav any good referrence link or website got introduce this infomation. It is because i quite rush for this, therefore hope anyone can help....

    Thanks for viewing and reply.  

    Tuesday, January 6, 2009 10:47 PM

Answers

  • User-1171043462 posted

    try this out

    string strQuery = "SELECT * FROM Table1 WHERE CompanyName LIKE '%' + @CName + '%'";

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, January 6, 2009 11:45 PM
  • User-1199946673 posted

    mudassarkhan already gave the correct answer, but you could read some more on this here

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, January 7, 2009 3:57 AM

All replies

  • User-1171043462 posted

    try this out

    string strQuery = "SELECT * FROM Table1 WHERE CompanyName LIKE '%' + @CName + '%'";

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, January 6, 2009 11:45 PM
  • User-1199946673 posted

    mudassarkhan already gave the correct answer, but you could read some more on this here

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, January 7, 2009 3:57 AM