Executing a parmeterized SQL string
Posted: Thu 02 Feb 2012 19:53
I want to create a SQL string with some parameters in it like this:
string sql = "select field1 From mytable where field2 = @param"
then I want to add a parameter to my command object and execute it. How do I get the command object to recognize that there is a parameter is the string that need to be replaced?
string sql = "select field1 From mytable where field2 = @param"
then I want to add a parameter to my command object and execute it. How do I get the command object to recognize that there is a parameter is the string that need to be replaced?