SQL datatype Text

  • Thread starter Thread starter William Newsom
  • Start date Start date
W

William Newsom

for the life of my my dataset cannot save to the text column of the sql
server i keep getting this error

"String or binary data would be truncated."

The sql column is datatype of "text" to capture a multined textbox that is
in HTML

I ha sql code like this



Me.SqlUpdateCommand1.CommandText = "[LenderFinancialUpdateCommand]"

Me.SqlUpdateCommand1.CommandType = System.Data.CommandType.StoredProcedure

Me.SqlUpdateCommand1.Connection = Me.SqlConnection1

Me.SqlUpdateCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@Fees", System.Data.SqlDbType.Int, 4,
"Fees"))

Me.SqlUpdateCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@Interest",
System.Data.SqlDbType.VarChar, 10, "Interest"))

Me.SqlUpdateCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@Stips", System.Data.SqlDbType.VarChar,
2147483647, "Stips"))

Me.SqlUpdateCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@Amount", System.Data.SqlDbType.VarChar,
10, "Amount"))

Me.SqlUpdateCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@FK_LID", System.Data.SqlDbType.Int, 4,
"FK_LID"))

'SqlDeleteCommand1

i have tried dropping the datatype reference from the parameters.add to no
avail



William
 
Yes it is the data

in a multilined text box in html the user can enter carriage returns so the
data looks like this

1. enter enter
enter asdfasdfasdf
adsf
adsfsa
df
adsf


that same exact format so when it is pulled again and you populate the
textbox it will retain its original formatting. I know that the text
datatype is HUGE and can hold just about anything but the data adapter
doesnt seem to know that.



William Ryan said:
Looks like the value you are passing in won't fit in the field in the DB.
Will it take any values, or is it a specifc value? 90% that 's it if you've
adjusted the datatpye locally.

HTH
William Newsom said:
for the life of my my dataset cannot save to the text column of the sql
server i keep getting this error

"String or binary data would be truncated."

The sql column is datatype of "text" to capture a multined textbox that is
in HTML

I ha sql code like this



Me.SqlUpdateCommand1.CommandText = "[LenderFinancialUpdateCommand]"

Me.SqlUpdateCommand1.CommandType = System.Data.CommandType.StoredProcedure

Me.SqlUpdateCommand1.Connection = Me.SqlConnection1

Me.SqlUpdateCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@Fees", System.Data.SqlDbType.Int, 4,
"Fees"))

Me.SqlUpdateCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@Interest",
System.Data.SqlDbType.VarChar, 10, "Interest"))

Me.SqlUpdateCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@Stips", System.Data.SqlDbType.VarChar,
2147483647, "Stips"))

Me.SqlUpdateCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@Amount", System.Data.SqlDbType.VarChar,
10, "Amount"))

Me.SqlUpdateCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@FK_LID", System.Data.SqlDbType.Int, 4,
"FK_LID"))

'SqlDeleteCommand1

i have tried dropping the datatype reference from the parameters.add to no
avail



William
 
Looks like the value you are passing in won't fit in the field in the DB.
Will it take any values, or is it a specifc value? 90% that 's it if you've
adjusted the datatpye locally.

HTH
 
If it's going to be more than 8,000 Characters, VarChar won't do it. You'll
probably need to read it into a stream, and then load it as a BLOB...here's
a link that shows you how to do it with a Bitmap, but the logic is
identical.... http://support.microsoft.com/default.aspx?kbid=308042

HTH
William Newsom said:
Yes it is the data

in a multilined text box in html the user can enter carriage returns so the
data looks like this

1. enter enter
enter asdfasdfasdf
adsf
adsfsa
df
adsf


that same exact format so when it is pulled again and you populate the
textbox it will retain its original formatting. I know that the text
datatype is HUGE and can hold just about anything but the data adapter
doesnt seem to know that.



William Ryan said:
Looks like the value you are passing in won't fit in the field in the DB.
Will it take any values, or is it a specifc value? 90% that 's it if you've
adjusted the datatpye locally.

HTH
that
is
in HTML

I ha sql code like this



Me.SqlUpdateCommand1.CommandText = "[LenderFinancialUpdateCommand]"

Me.SqlUpdateCommand1.CommandType = System.Data.CommandType.StoredProcedure

Me.SqlUpdateCommand1.Connection = Me.SqlConnection1

Me.SqlUpdateCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@Fees", System.Data.SqlDbType.Int, 4,
"Fees"))

Me.SqlUpdateCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@Interest",
System.Data.SqlDbType.VarChar, 10, "Interest"))

Me.SqlUpdateCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@Stips", System.Data.SqlDbType.VarChar,
2147483647, "Stips"))

Me.SqlUpdateCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@Amount", System.Data.SqlDbType.VarChar,
10, "Amount"))

Me.SqlUpdateCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@FK_LID",
System.Data.SqlDbType.Int,
4,
"FK_LID"))

'SqlDeleteCommand1

i have tried dropping the datatype reference from the parameters.add
to
 
Its not longer than 8000 . what makes it special is the multilined aspect.
If anyone has used the textbox control with multilined on the point is made.
Single line entries go into the database fine its when a user hits return
and starts typing on a new line

William Ryan said:
If it's going to be more than 8,000 Characters, VarChar won't do it. You'll
probably need to read it into a stream, and then load it as a BLOB...here's
a link that shows you how to do it with a Bitmap, but the logic is
identical.... http://support.microsoft.com/default.aspx?kbid=308042

HTH
William Newsom said:
Yes it is the data

in a multilined text box in html the user can enter carriage returns so the
data looks like this

1. enter enter
enter asdfasdfasdf
adsf
adsfsa
df
adsf


that same exact format so when it is pulled again and you populate the
textbox it will retain its original formatting. I know that the text
datatype is HUGE and can hold just about anything but the data adapter
doesnt seem to know that.



William Ryan said:
Looks like the value you are passing in won't fit in the field in the DB.
Will it take any values, or is it a specifc value? 90% that 's it if you've
adjusted the datatpye locally.

HTH
for the life of my my dataset cannot save to the text column of the sql
server i keep getting this error

"String or binary data would be truncated."

The sql column is datatype of "text" to capture a multined textbox
that
is
in HTML

I ha sql code like this



Me.SqlUpdateCommand1.CommandText = "[LenderFinancialUpdateCommand]"

Me.SqlUpdateCommand1.CommandType = System.Data.CommandType.StoredProcedure

Me.SqlUpdateCommand1.Connection = Me.SqlConnection1

Me.SqlUpdateCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@Fees",
System.Data.SqlDbType.Int,
4,
"Fees"))

Me.SqlUpdateCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@Interest",
System.Data.SqlDbType.VarChar, 10, "Interest"))

Me.SqlUpdateCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@Stips",
System.Data.SqlDbType.VarChar,
2147483647, "Stips"))

Me.SqlUpdateCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@Amount",
System.Data.SqlDbType.VarChar,
10, "Amount"))

Me.SqlUpdateCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@FK_LID", System.Data.SqlDbType.Int,
4,
"FK_LID"))

'SqlDeleteCommand1

i have tried dropping the datatype reference from the parameters.add
to
no
avail



William
 
Back
Top