250 Character limit on db writes?

  • Thread starter Thread starter Jason
  • Start date Start date
J

Jason

I have a simply sql insert statement that takes a txtbox as a parameter and
writes it to the database. When I do so however, it truncates the text from
the txtbox to 250 characters.

I know the txtbox allows more than 250 characters (I set a max length to
2500 characters in fact) and the database allows 2500 characters as well on
the field I'm writing to. If I manually edit the entry in the db to be over
250 characters, then retrieve information to this same txtbox from the db,
the txtbox retrieves the data just fine.

Any suggestions from anyone?

Here's a sample of the code I'm using to write to the db:

'Insert Change in tbl_Changes
With cmdCreateNewRequest
.Parameters("@Change_Description").Value = txtChange_Description.Text
End With
SqlConnection1.Open()
cmdCreateNewRequest.ExecuteNonQuery()

My sql command 'cmdCreateNewRequest' is simple:

INSERT INTO tbl_Changes
(Change_Description)
VALUES @Change_Description)

Any ideas or info on this would be greatly appreciated.

Thanks,

Jason
 
Hi Jason,

Did you specify size for your parameter when you instantiated it? If not,
then you could experience this issue
 
I figured it out:

All I had to do is add the following code immediately after the .parameter
declaration:

..Parameters.Item(0).Size = 2500
 
Back
Top