Wednesday, March 28, 2012

What is SQLdatasource parameter 'size'?

Hi,
I'm new to ASP.NET 2.0 and I am trying to get more information on the
size property within the parameter tag of the SQLdatasource control.
I have this code as an example...
<asp:Parameter Type="String" Name="NewID" Direction="Output" Size="4">
Does Size="4" represent 4 characters in length? In the case of an
IDENTITY integer being returned after an INSERT, does having size = "4"
mean that the integer can be up to 9999?
What does the number represent?!
Thanks in advance,
John.
*** Sent via Developersdex http://www.examnotes.net ***> Hi,
> I'm new to ASP.NET 2.0 and I am trying to get more information on the
> size property within the parameter tag of the SQLdatasource control.
> I have this code as an example...
> <asp:Parameter Type="String" Name="NewID" Direction="Output" Size="4">
> Does Size="4" represent 4 characters in length? In the case of an
> IDENTITY integer being returned after an INSERT, does having size = "4"
> mean that the integer can be up to 9999?
> What does the number represent?!
> Thanks in advance,
> John.
> *** Sent via Developersdex http://www.examnotes.net ***
For a string it's the size in characters. Your example corresponds to a
"char(4)" (or "varchar(4)", "nchar(4)" or "nvarchar(4)") in SqlServer.
I don't think the size is be needed for integers, but then it would be
the size in bytes, not the number of digits in the decimal
representation of the value.
Hans Kesting

0 comments:

Post a Comment