What size do you use for varchar(MAX) in your parameter declaration?

前端 未结 5 835
眼角桃花
眼角桃花 2020-11-30 01:25

I normally set my column size when creating a parameter in ADO.NET

But what size do I use if the column is VARCHAR(MAX)?

cmd.Parameters.         


        
5条回答
  •  情话喂你
    2020-11-30 02:10

    For those of us who did not see -1 by Michal Chaniewski, the complete line of code:

    cmd.Parameters.Add("@blah",SqlDbType.VarChar,-1).Value = "some large text";
    

提交回复
热议问题