Monday, March 19, 2012

A baffeling problem between a text box and database table.

I have a web form with a text box that when submited gets put in a field in a table in an SQL database. Only 50 characters were being passed to the table. I gave the text box a max size of 200 characters and also found that the field in my table was set at 50 char. I had my SA set the field to 200 char. I rebuilt the solution and yet I am still only getting 50 charecters in the table. Any ideas?Show how you are setting the field in SQL Server.|||This is what I am doing to update my database.
'comments' is the field in question.
_______________________________________

Private Sub Update_Dataset()
Dim dr As DataRow = DataSet11.Tables("Results").NewRow()
dr("Area") = Area.SelectedItem
dr("Q1") = Q1.SelectedIndex + 1
dr("Q2") = Q2.SelectedIndex + 1
dr("Q3") = Q3.SelectedIndex + 1
dr("Q4") = Q4.SelectedIndex + 1
dr("Q5") = Q5.SelectedIndex + 1
dr("Q6") = Q6.SelectedIndex + 1
dr("Q7") = Q7.SelectedIndex + 1
dr("Q8") = Q8.SelectedIndex + 1
dr("Q9") = Q9.SelectedIndex + 1
dr("Comments") = Comments.Text
dr("ID") = 0
DataSet11.Tables("Results").Rows.Add(dr)
OleDbDataAdapter1.Update(DataSet11, "Results")

End Sub

__________________________________________________________

No comments:

Post a Comment