I have a stored procedure in SQL Server:

procedure proc_xxx
@textOut Text output
As
Declare @ptrval varbinary(16)

Select @textOut = someTextField
From myTable
Where...
READTEXT myTable.someTextField @ptrval 0 0

I'm also using the MS Data Access Application Block, which
I doubt is the problem here, with the following code
snipet:

parms[1] = new SqlParameter("@someTextField",
SqlDbType.Text);
parms[1].Direction = ParameterDirection.Output;

SqlHelper.ExecuteNonQuery(_connectionString,
CommandType.StoredProcedure,
"proc_xxx", parms);

When executing, I get the following error message:
Parameter 1: '@someTextFieldof type: String, the property
Size has an invalid size: 0

Where am I going wrong? in the stored procedure? in the
SqlDbType setting?

Thanks
Alex Dinu
alex_dinu@adp.com

Re: Retrieving Text data type - help by Miha

Miha
Wed Jan 07 14:58:38 CST 2004

Hi Alex,

Try setting parms[1].Size = 2,147,483,647

--
Miha Markic - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

"Alex" <alexdinu1@hotmail.com> wrote in message
news:00b601c3d551$82458fd0$a501280a@phx.gbl...
> I have a stored procedure in SQL Server:
>
> procedure proc_xxx
> @textOut Text output
> As
> Declare @ptrval varbinary(16)
>
> Select @textOut = someTextField
> From myTable
> Where...
> READTEXT myTable.someTextField @ptrval 0 0
>
> I'm also using the MS Data Access Application Block, which
> I doubt is the problem here, with the following code
> snipet:
>
> parms[1] = new SqlParameter("@someTextField",
> SqlDbType.Text);
> parms[1].Direction = ParameterDirection.Output;
>
> SqlHelper.ExecuteNonQuery(_connectionString,
> CommandType.StoredProcedure,
> "proc_xxx", parms);
>
> When executing, I get the following error message:
> Parameter 1: '@someTextFieldof type: String, the property
> Size has an invalid size: 0
>
> Where am I going wrong? in the stored procedure? in the
> SqlDbType setting?
>
> Thanks
> Alex Dinu
> alex_dinu@adp.com