I am writing an application using VS2008 and SQL Server 2005. I have
code that executes a stored procedure for a table that has a field
which is varchar(max). I usually use code as follows to create and
populate a parameter...
SQLParam(8) = New System.Data.SqlClient.SqlParameter
With SQLParam(8)
.ParameterName = "@LastProcessingResults"
.DbType = DbType.String
.Direction = ParameterDirection.Input
.Size = 1000
.Value = _LastProcessingResults
End With
However, obviously, in this case, I don't want to set .Size = 1000.
What do I set .Size equal to for a varchar(max) field? Or, do I leave
out the .Size property altogether?
BobRoyAce - 21 Mar 2008 04:24 GMT
> However, obviously, in this case, I don't want to set .Size = 1000.
> What do I set .Size equal to for a varchar(max) field? Or, do I leave
> out the .Size property altogether?
I tried not setting the .Size property at all (believe it defaults to
ZERO) and that seems to work. Is this the correct way to implement it?
Ralph - 21 Mar 2008 15:25 GMT
> I am writing an application using VS2008 and SQL Server 2005. ...
This is the wrong newsgroup. This group is populated by programmers using
classic VB (VB6 or lower) and classic ADO (not ADO.NET).
You will be better served in a dotNet group (they all have "dotNet" in the
title), since there will be more programmers monitoring those groups that
use VB.Net, and any answers you get will also receive better scrutiny.
-ralph
BobRoyAce - 21 Mar 2008 16:36 GMT
> You will be better served in a dotNet group (they all have "dotNet" in the
> title), since there will be more programmers monitoring those groups that
> use VB.Net, and any answers you get will also receive better scrutiny.
Oops...thanks for the heads-up! :)