WHERE IN CLAUSE acts up with more than one variable in a string

  • Thread starter Thread starter anna
  • Start date Start date
A

anna

i have a stored procedure that is called by a SqlDataAdapter that has
a "WHERE (CustomerNumber IN (@CustNumber)". It works when it is
only one customer number in the @custNumber parameter. If more than
one customer number is selected and passed to the parameter, the
result set is null. I tried putting a ‘ in the beginning and at the
end of the string, I tried splitting it with a ‘,-- still does not
work.
In sql, if you put customer numbers separated by a comma, it puts open
and closing single quotes, somehow it does not work the same within
..Net. Any ideas will be greatly appreciated
 
Hi Anna:
anna said:
i have a stored procedure that is called by a SqlDataAdapter that has
a "WHERE (CustomerNumber IN (@CustNumber)". It works when it is
only one customer number in the @custNumber parameter. If more than
one customer number is selected and passed to the parameter, the
result set is null. I tried putting a ' in the beginning and at the
end of the string, I tried splitting it with a ',-- still does not
work.
In sql, if you put customer numbers separated by a comma, it puts open
and closing single quotes, somehow it does not work the same within
.Net. Any ideas will be greatly appreciated

This should help http://www.knowdotnet.com/articles/temptables.html
 
Back
Top