Home » Programming / Coding

the Size property has an invalid size of 0 : MS SQL

4 December 2008 1,495 views No Comment

I was working on calling a MS SQL stored procedure from a .NET application. Then I got this error “the Size property has an invalid size of 0″.

Looking over I saw I have a return variable of VARCHAR type. And that does not have a size specified. Just adding the size got it working.

Here is an example code:

param = command.Parameters.Add(“@clientName”,SqlDbType.VarChar,150);
param.Direction = ParameterDirection.Output;

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.