I'm having a problem calling strored procedures that accept lists of values which are passed to an "IN" operator. It seems as if length property of the the input parameter "2,3,4,5,6,7,8,9,10" is being evaluated a as 1 and not as the true lenght of the parameter.
this causes a problem when the parameter is passed ot the CallRetrievalStoredProcedure method, because the CallRetrievalStoredProcedure looks at the length property of the parameter (see 'for' loop below) and not the parameter.Value.Length, which would be "2,3,4,5,6,7,8,9,10". As a result, only the first character of the string is being passed to the stored proc.
I know i'm not the first to encounter this issue. How have others worked around this?
thanks
using(SqlDataAdapter adapter = (SqlDataAdapter)CreateNewPhysicalDataAdapter())
{
adapter.SelectCommand = command;
for(int i=0;parameters.Length;i++)
{
command.Parameters.Add(parameters[i]);
}
adapter.Fill(tableToFill);
}