PC Review


Reply
Thread Tools Rate Thread

DataSet concept question.... Help with data merging

 
 
Nestor
Guest
Posts: n/a
 
      18th Mar 2004
I'm confused with the way Dataset works in ADO.Net, especially when it
comes to dataset merging.

Assuming I have 2 dataset (DS1 and DS2), in which 1 comes from a
SQLServer and the other came from another datasource (eg. Access). If
I were to merge the two Dataset into DS1 and update the dataset into
Access again, I'll get a concurrency constraint error.

Example
DS1 - Source Dataset
DS2 - Target Dataset

Both DS have Table["TestTable"] have Row[0] as their primary key..

DS1 have the following data:
Row[0][1] = "TestingReplace"
Row[1][1] = "TestingNew"

DS2 have the following data:
Row[0][1] = "Testing"

DS2.merge(DS1,true,ignore) will merge the ds1's table into ds2's
table, and the new data will be

DS2's new data:
Row[0][1] (Original Version) = "TestingReplace"
Row[0][1] (Current Version) = "Testing"
Rowstate = modified

Row[1][1] (Original Version) = "TestingNew"
Row[1][1] (Current Version) = "TestingNew"
rowstate = unchanged

If the dataset is now updated using this statement
DS2DataAdapter.update(DS2, "TestTable")

we'll have an error since the original version's value have been
changed! on top of that the new row that's added are not having its
rowstate changed to "Added"

My Questions is:

1. Why does merge changes the original value instead of its current
value?
2. why doesn't the example above change its row rowstate into "Added"?


please help to clarify this...thanks
 
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
DataSet Question -- Simple Concept? Beginner to 3-Tier asp.net Rangy Microsoft ADO .NET 3 29th Nov 2006 04:44 AM
Problems/Doubts: Implementing Disc. DB concept(Dataset)!!! =?Utf-8?B?c2F1cmFiaA==?= Microsoft ADO .NET 3 9th Jun 2004 01:01 PM
Merging Data with strong typed DataSet BenLeino Microsoft ADO .NET 0 30th May 2004 09:41 PM
Help! -Useful Data Entry concept - poor development concept Adam Hobart Microsoft Access VBA Modules 2 18th Feb 2004 09:06 PM
Re: Merging untyped dataset into a typed dataset (GUID problems) Lewis Edward Moten III Microsoft ADO .NET 0 14th Jul 2003 09:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:57 AM.