Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

textbox and refreshing dataset

Status
Not open for further replies.

HomerJS

Programmer
Jun 25, 2001
86
0
0
US
I have textboxes on a form that are bound to a dataset. I updated the dataset because of changes and now the textboxes do not display the data when I fill the dataset. There is data in the dataset because MsgBox(DsInfo1.Customers.Rows(0).Item("Name")) gives me a value.

Any ideas on what I can check?
 
Does the DataSet give you the new or old value? Are you checking it before or after you filled the DataSet? If you are checking it before, then filling the DataSet, if the changes have not made it to the database, you won't be getting them after you Fill.
 
The dataset gives me the new (correct) value. I check it after I fill the dataset.
 
I should also mention that if I add a completely new text box and bind it to the same data, the new textbox does return the correct value. The textbox that was originally on the form does not.
 
Hmmm, we would have to see your code to try to figure it out.
 
Here's the basics of it . . .

'textbox that does not work
'txtState
'
Me.txtState.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.DsInfo1, "Customers.State"))
Me.txtState.Location = New System.Drawing.Point(300, 172)
Me.txtState.MaxLength = 2
Me.txtState.Name = "txtState"
Me.txtState.Size = New System.Drawing.Size(28, 20)
Me.txtState.TabIndex = 6


'textbox that does work
'TextBox2
'
Me.TextBox2.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.DsInfo1, "Customers.State"))
Me.TextBox2.Location = New System.Drawing.Point(496, 500)
Me.TextBox2.MaxLength = 2
Me.TextBox2.Name = "TextBox2"
Me.TextBox2.Size = New System.Drawing.Size(96, 20)
Me.TextBox2.TabIndex = 73


daCustomer.Fill(DsInfo1.Customers)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top