So ... you want the additional classe to be executed as if it were
and ingredients in ('pepper','salt','eggs')
therefore you need to build a string that looks like:
" and ingredients in ('pepper','salt','eggs')"
To get the puncuation right you can use a technique like:
string ingredients = "pepper,salt,eggs";
strSql += String.Format(" and ingredients in ('{0}')",
ingredients.Split(',').Join("','"));
Then you just have to remember to assign strSql to the CommandText property
of sda.SelectCommand.
"jayv" <ja**@discussions.microsoft.comwrote in message
news:80**********************************@microsof t.com...
The best way to explain it, is to show you what i "thought" should work
and
hope that you can show me a way to make it work please and thanks...
string ingredients = "pepper,salt,eggs";
strSql += " AND ingredients IN @pIngredients";
string[] myList = ingredients.Split(',');
sda.SelectCommand.Parameters.AddWithValue("@pIngre dients", myList);
the error is: System.ArgumentException: No mapping exists from object type
System.String[] to a known managed provider native type.