In your example I want to replase '123','23423','34535' whit a call to a sting, so I have
select * from table where GUID in (@mystring)
mystring=" '123','23423','34535' ";
var
cmd3 = newSqlCommand(sql3,
conn);
cmd3.Parameters.AddWithValue(
"guid",
mystring);
The problem in this is that this will give the result as if im searching for the hole string instead
of 3 values. And the reason I want to do it like this, Is that my numers of values in the instatement are changing
fernlle
None
0 Points
5 Posts
Re: How to search with variable parameters?
Apr 02, 2012 01:04 PM|LINK
In your example I want to replase '123','23423','34535' whit a call to a sting, so I have
select * from table where GUID in (@mystring)
mystring=" '123','23423','34535' ";
var cmd3 = new SqlCommand(sql3, conn);
cmd3.Parameters.AddWithValue(
"guid", mystring);
The problem in this is that this will give the result as if im searching for the hole string instead of 3 values. And the reason I want to do it like this, Is that my numers of values in the instatement are changing