string not fully populated in sql
am 23.01.2008 19:21:01 von MSDNNospam213To all,
I'm using the following to create a string of text and to insert into a
table/column:
strBuilder.append("User Full Name") ....this is inside a loop that may
increment 35 times. For 35 different names.
I then use the following code to insert the data into a table/column:
sqlCommand.Parameters.Add("@Full_NM", SqlDbType.VarChar, 2000)
sqlCommand.Parameters("@Full_NM").Direction = ParameterDirection.Input
sqlCommand.Parameters("@Full_NM").Size = Len(strBuilder.ToString)
sqlCommand.Parameters("@Full_NM").Value = strBuilder.ToString
However when I run my code not all the full names are entered into my table
and the number of characters are no more than 516 characters long .....so I'm
not going beyond 2000 characters. I also step through my code and see all
the values strBuilder.tostring to be correct. It's only different/truncated
after an insert occurs into my table. My table definition has the datatype
of varchar with a domain of 2000 characters. My data seems to get truncated
after 306 characters and after my code runs.
Any advise,
Michael