Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid and textbox not in sync
Message
 
 
To
08/12/2004 15:53:03
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
00967844
Message ID:
00967860
Views:
7
Thanks Bonnie,

Tried calling the Adapter.Update and passing the changes table, and it worked:
Dim oChanges as DataTable = Methods1.Tables("ExtraMethods").GetChanges()
If Not oChanges Is Nothing Then
  oAdapter.Update(oChanges)
End If
>Rick,
>
>The only thing that AcceptChanges() does is mark your DataSet has having no changes. It does nothing as far as updating your database. A DataSet is a disconnected object. That means it's totally disconnected from the database.
>
>~~Bonnie
>
>
>
>>Hi Hector,
>>
>>Now I cant get the textbox to actually update the database (sheesh! < g >).
>>
>>I was able to fix the sync problem with the line
>>
>>
>>txtContent.DataBindings.Add("text", Methods1.Tables("ExtraMethods"), "Content")
>>
>>
>>I have tried the following in both the LostFocus and the close of the form
>>
>>
>>If Methods1.HasChanges Then
>>   Methods1.AcceptChanges
>>End If
>>
>>and
>>
>>Dim oChanges as DataTable = Methods1.Tables("ExtraMethods").GetChanges()
>>If Not oChanges Is Nothing Then
>>   oChanges.AcceptChanges()
>>End If
>>
>>
>>
>>Any ideas??
>>
>>
>>
>>>Make sure they are both bound to the same object. What I mean is that, since there are several ways to bind to the grid, is that sometimes .NET does not realize that both of them are bound to the same object.
>>>
>>>Could you post the lines of code that do the binding for the textbox and the grid?
>>
>>
>>
>>
>>>>I dropped a grid and a textbox onto a form, I bind the grid to a SQL Server table and i bind the textbox to a text field in the table.
>>>>
>>>>The grid fills fine and so does the text box, but when I navigate to a different row in the grid, the textbox is still bound to the original row
>>>>
>>>>TIA,
>>>>
>>>>Rick
>>>
Rick Hodder
MCP Visual Foxpro
C#, VB.NET Developer
Independent Consultant
www.RickHodder.com
MyBlog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform