I have a problem with a sql query. Through the query I am trying to search database for any occurrences of string (can be anything) in a column using the SQL LIKE command. The problem is that it works fine for most of the strings say john, jim, ji"m , but does not work when i include the following characters which are ( ' , { , } , and a single quotation mark). MYSQL query takes care of these special cases by putting them in [] block whenever user enters them .
But i am getting the following error when i go to query the database using the GetSelectCommand() in VB.NET
Exception Details:
System.ApplicationException:
Number of values provided must be equal to the number of placeholders in query.
I have checked the query over and over again .. but its fine .
My database server is Sql Server 2008.
So my application throws the exception in this command:
Using reader As MustDisposeDataReader = _
pmSystem.DatabaseManager.GetSelectCommand(selectStatementBuilder.ToString(), New Object() {})
Where MustDisposeDataReader
is an instance of a class in an internally developed library, which inherits from System.Object
. pmSystem
is an instance of the class PlanManagerSystem
which implements the commandlayer. GetSelectCommand()
takes the select command