0

would someone help me how to set the parameter with varchar(max) in .net thanks in advance

There is my code:

Dim param As SqlParameter = Nothing

        Select Case strParameter
        Case "@item"
                param = New SqlParameter(strParameter, SqlDbType.VarChar, 50)
            Case "@value"
                param = New SqlParameter(strParameter, SqlDbType.VarChar,  max)
        End Select
        param.Value = objDBHandlers.getValue(objValue)
Kritner
  • 13,557
  • 10
  • 46
  • 72
user819774
  • 1,456
  • 1
  • 19
  • 48
  • 2
    Pass `-1` as the size. – RBarryYoung Jun 09 '15 at 14:21
  • possible duplicate of [What size do you use for varchar(MAX) in your parameter declaration?](http://stackoverflow.com/questions/973260/what-size-do-you-use-for-varcharmax-in-your-parameter-declaration) – actaram Jun 09 '15 at 14:28

0 Answers0