PC Review


Reply
Thread Tools Rate Thread

Re: Dataset Binding

 
 
Brian Parlier
Guest
Posts: n/a
 
      16th Mar 2004
When you create the DataAdapter set the AcceptChangesDuringFill property to
false

This will force all the rows inserted into the dataset to be marked as new
rows therefore allowing you to call the DataAdapters update method to submit
the rows to the database.

Good Luck
Brian Parlier


"HectorG" <(E-Mail Removed)> wrote in message
news:6284EB4C-B6FC-4F1B-92AD-(E-Mail Removed)...
> Hi,
>
> I've an webservice that returns a dataset. I want to insert the content of

one of the tables of the dataset into a SQL table in my SQL Server. The
problem is that i don't want to make a loop to insert record by record, and
also, i want to apply the current insert/update method to update the data in
the database.
>
> The scenario is something like a replication: recover data from an online

database, wich comes into a dataset, and then update this data in my
database (tables), considering that some of these records should exists on
the local copy, so they must be updated, and some others shouldn't, so must
be inserted.
>
> I've tried using a dataadapter and commandbuilder, and updating the

dataadapter with the dataset that returns the webservice, but it doesn't
work. Can you help me, maybe with some code, or explanation? Thanks!


 
Reply With Quote
 
 
 
 
=?Utf-8?B?SGVjdG9yRw==?=
Guest
Posts: n/a
 
      16th Mar 2004
yeah, but the problem is that, the dataset come with data already, so the rows aren't inserted in this method of the class. I mean, I declare an object of type dataset, and says that this dataset will content the result of the webservice method:
dim dtSet as new DataSet()
dtSet = webService.getPersons()

and then, I call the update method of the data adapter, with DtAdapter.Update(dtSet), having declared the dataadapters command:

Dim dtadap As New SqlDataAdapter("SELECT * FROM myTable", mySqlCon)
Dim dsCB As New SqlCommandBuilder(dtadap)
dtadap.AcceptChangesDuringFill = False

But, it doesn't work. I must confess that i'm completely loss...
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Binding to a DataSet with more than one DataTable =?Utf-8?B?RGljaw==?= Microsoft ASP .NET 9 7th Feb 2007 09:07 AM
help binding a dataset Jake Smythe Microsoft VB .NET 2 17th Nov 2005 09:03 AM
Binding to DataSet sck10 Microsoft ASP .NET 2 4th Nov 2004 02:36 AM
DataSet Binding Ghost Microsoft Dot NET Compact Framework 6 5th Aug 2004 08:06 AM
BUG in Dataset Binding?? Juergen Bronn Microsoft Dot NET Framework Forms 0 17th Jul 2003 12:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:55 PM.