|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Updating a dataadapterHi Gang.
I'm using VB.Net 2003. In the following code I'm updating the dataadapter with a new record added to the table: OleDbDataAdapter1.Update(DataSet11.GetChanges, "Table") However, when I add another record and update the dataadapter again, the first record gets added a second time. Is there something else that needs to be done after doing the update? Thanks a lot!! Mike. Rather than calling DataSet11.GetChanges, just call the Dataset.
Ie: OleDbDataAdapter1.Update(DataSet11, "Table") Alternatively you can keep your existing code and call: DataSet11.AcceptChanges() after the line of code specified below. mfleet1***@yahoo.ca wrote: Show quoteHide quote > Hi Gang. > > I'm using VB.Net 2003. In the following code I'm updating the > dataadapter with a new record added to the table: > > OleDbDataAdapter1.Update(DataSet11.GetChanges, "Table") > > However, when I add another record and update the dataadapter again, > the first record gets added a second time. Is there something else > that needs to be done after doing the update? > > Thanks a lot!! > > Mike. MFleet,
In addition to Steven, this behaviour is because the getchanges creates a copy dataset. Cor <mfleet1***@yahoo.ca> schreef in bericht Show quoteHide quote news:1150850626.501497.99630@p79g2000cwp.googlegroups.com... > Hi Gang. > > I'm using VB.Net 2003. In the following code I'm updating the > dataadapter with a new record added to the table: > > OleDbDataAdapter1.Update(DataSet11.GetChanges, "Table") > > However, when I add another record and update the dataadapter again, > the first record gets added a second time. Is there something else > that needs to be done after doing the update? > > Thanks a lot!! > > Mike. >
Password Protect
DataBinding with Unbound Columns and calling EndCurrentEdit ListBox Problem firing a dts package's execution How To Show Partial Classes as a Hierarchy in Solution Explorer? Limit ComboBox entry to ipaddress format XML WebSvc Proxy Code Syntax Questions get the month (number) and year value from a date HOW Change Password Passing a parameter Collection |
|||||||||||||||||||||||