Problem with Parameter list in stored proc

Posts   
 
    
lyndon_h
User
Posts: 79
Joined: 14-Sep-2004
# Posted on: 20-Feb-2008 17:57:17   

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);
            }

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 21-Feb-2008 03:16:50   

Hi,

To clarify a bit so we can help you better, could you please provide us:

  1. The DDL (only the header) of your Stored procedure, to see what exactly the SP is looking for.

  2. What is the type of the parameter at LLBLGenPro Designer?

  3. Your .Net code that builds the string or object passed in to the CallRetrievalStoredProcedure, and the call to the CallRetrievalStoredProcedure.

  4. Last but not less, the LLBLGenPro version and RuntimeLibraries version (rightclick on ormsupportclasses dll in explorer -> properties -> version tab).

David Elizondo | LLBLGen Support Team
lyndon_h
User
Posts: 79
Joined: 14-Sep-2004
# Posted on: 21-Feb-2008 17:31:15   

Nevermind. Error on my part. I needed to refresh the catalog in the designer. When i did, the size property of the parameter changed from 1 to 2147483647 (its a nvarchar(MAX))

thanks for you help.