473,387 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Updating a dataadapter

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.

Jun 21 '06 #1
2 1152
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.

mf********@yahoo.ca wrote:
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.


Jun 21 '06 #2
MFleet,

In addition to Steven, this behaviour is because the getchanges creates a
copy dataset.

Cor

<mf********@yahoo.ca> schreef in bericht
news:11*********************@p79g2000cwp.googlegro ups.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.

Jun 21 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Tc | last post by:
Hi, I was curious, I am thinking of writing an application that loads a dataset from a database that resides on a server. The question I have is this, if multiple copies of the app will be...
4
by: Dave Taylor | last post by:
I've been using the dataset designer in Visual Studio to create typed datasets for my application by dragging over tables from the Server Explorer and dropping them into the designer. The problem...
13
by: Doug Bell | last post by:
Hi, I thought I had this sorted this morning but it is still a problem. My application has a DataAccess Class. When it starts, it: Connects to a DB (OLE DB) If it connects it uses an...
2
by: Jason Huang | last post by:
Hi, I am wondering why use the DataTableMapping in SqlDataAdapter when Updating data. Would someone give me some advice? Thanks for help. Jason
4
by: Geoff | last post by:
Hi I'm hoping somebody can help me with the following problem that has occurred to me. Suppose I have two tables in an SQL Server database. Let's call these tables A and B. Assume that A has...
3
by: RSH | last post by:
Hi, I have a situation in where i have two instances of SQL server, the first is our Production Environment, the second is our Development environment. Both servers contain the same databases...
2
by: susan.f.barrett | last post by:
Hi, Despite me being able to type the following in to SQL Server and it updating 1 row: > updatestockcategory 1093, 839 In my code, it is not updating any rows. dataSet = new DataSet();
7
by: David P. Donahue | last post by:
My experience with databases using C# has been pretty limited thus far. Mostly I just use a SELECT statement to populate a DataSet, which is just read-only (mostly for display on a web page), or...
6
by: Rich | last post by:
Dim da As New SqlDataAdapter("Select * from tbl1", conn) dim tblx As New DataTable da.Fill(tblx) '--works OK up to this point da.UpdateCommand = New SqlCommand da.UpdateCommand.Connection =...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.