>>>>The CreateParameter method takes care of that for you. If you pass in a string it will be a string. If you pass in a zero it will be an integer. The length gets set also. I just tested and with a string of "00" the length gets set to 2.
>>>>Tim
>>>>
>>>
>>>Ok, I'm also guessing you have overloads to pass length and type explicitly, right?
>>>
>>
>>No, but overload to pass in parameter type and the direction. The length seems to be dynamic. I just tested it using a length of 10 but when it came back it was length of 1 because the value was 0.
>>
>>The problem seems to be the stored procedure because I can clearly see the parameter after the execution and it is named. The value is "0" so the stored procedure does not set the value of the parameter correctly. Here is the one I was using for a test.
>>
>>
>>
>>SET ANSI_NULLS ON
>>GO
>>SET QUOTED_IDENTIFIER ON
>>GO
>>
>>ALTER PROCEDURE [dbo].[GetNextNumber]
>> @NextNumber varchar(10) Output
>>AS
>>BEGIN
>> SET NOCOUNT ON;
>>
>> Set @NextNumber = '0000001045'
>>END
>>
>>
>>
>>What could be missing from the stored procedure?
>
>You declared parameter as varchar(10), so it's going to be truncated. Declare it as varchar(50) at least.
I am confused, the value I set was only 10 chars long. What would get truncated?
Timothy Bryan