473,799 Members | 3,740 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dataset Merge


I have aproblem when i merge datasets.
dsDS has 105 records
dsMain has 147 record
I am trying to to pour records in dsMain in to dsDS.

Here is my code:

DataSet dsDS =new DataSet();

SqlConnection conSqlConn = new SqlConnection(m _strdatabasecon Conn);

SqlDataAdapter daSQLDA = new SqlDataAdapter( "SELECT * FROM
scs_ds_employee ",conSqlCon n);

daSQLDA.Fill(ds DS);

dsDS.Merge(dsMa in,true);

return dsDS;
--
Ruslan Shlain
nAlliance Corporation
www.nAlliance.com

--
Ruslan Shlain
nAlliance Corporation
www.nAlliance.com
Nov 15 '05 #1
2 3618
I found the problem. I had to have the same names on the datatables, but it
seems that there is something else i am missing. When i do merge i get 249
rows. So instead of merge i ger append.
Any suggestions.
--
Ruslan Shlain
nAlliance Corporation
www.nAlliance.com
"Ruslan Shlain" <rs*****@hotmai l.com> wrote in message
news:OR******** *****@TK2MSFTNG P12.phx.gbl...

I have aproblem when i merge datasets.
dsDS has 105 records
dsMain has 147 record
I am trying to to pour records in dsMain in to dsDS.

Here is my code:

DataSet dsDS =new DataSet();

SqlConnection conSqlConn = new SqlConnection(m _strdatabasecon Conn);

SqlDataAdapter daSQLDA = new SqlDataAdapter( "SELECT * FROM
scs_ds_employee ",conSqlCon n);

daSQLDA.Fill(ds DS);

dsDS.Merge(dsMa in,true);

return dsDS;
--
Ruslan Shlain
nAlliance Corporation
www.nAlliance.com

--
Ruslan Shlain
nAlliance Corporation
www.nAlliance.com

Nov 15 '05 #2
The difference could be the primary key. If ADO.NET encounters rows that
have the same primary key values while it is merging data, it combines the
contents into a single row.

Peter
"Ruslan Shlain" <rs*****@hotmai l.com> wrote in message
news:e$******** ******@TK2MSFTN GP12.phx.gbl...
I found the problem. I had to have the same names on the datatables, but it
seems that there is something else i am missing. When i do merge i get 249
rows. So instead of merge i ger append.
Any suggestions.
--
Ruslan Shlain
nAlliance Corporation
www.nAlliance.com
"Ruslan Shlain" <rs*****@hotmai l.com> wrote in message
news:OR******** *****@TK2MSFTNG P12.phx.gbl...

I have aproblem when i merge datasets.
dsDS has 105 records
dsMain has 147 record
I am trying to to pour records in dsMain in to dsDS.

Here is my code:

DataSet dsDS =new DataSet();

SqlConnection conSqlConn = new SqlConnection(m _strdatabasecon Conn);

SqlDataAdapter daSQLDA = new SqlDataAdapter( "SELECT * FROM
scs_ds_employee ",conSqlCon n);

daSQLDA.Fill(ds DS);

dsDS.Merge(dsMa in,true);

return dsDS;
--
Ruslan Shlain
nAlliance Corporation
www.nAlliance.com

--
Ruslan Shlain
nAlliance Corporation
www.nAlliance.com


Nov 15 '05 #3

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

Similar topics

8
749
by: Bruce Stockwell | last post by:
the setup: Webservice/WinClient application/SQL server. VS.Net (visual basic) winform wizard creates a simple form with load cancel cancelall and datagrid bound to a simple Dataset with one Datatable. No coding by programer, All wizardry. User starts app, opens form, adds (4) records and clicks update.
3
1658
by: Li Weng | last post by:
Hi, I have an original dataset. It is copied to 2 different forms. Each form adds a new row to the same table in that dataset. When I merge these 2 dataset back to original one, the 2 new rows merge to one! My question is how I can still keep them as 2 rows in that table, not merge to one? Thanks. Li
2
4296
by: Mike Stephens | last post by:
A contact management application we previously developed for a customer now has a requirement to perform mail merging. Normally request like this would be very simple to solve, we were just point the mail merge data source to the database. But this request is a little bit different. The customer needs to perform the mail merge from the contacts in a dataset. Example In the main contact window the client has the ability to filter contact...
2
2110
by: muntyanu | last post by:
Hi all, I have problem when merging existing DataTable into new dataset. DataSet ds = new DataSet(); while ( done ) { // fill myCustomDataSet.MyTable with data ds.Merge( myCustomDataSet.MyTable, bPreserveChanges, MissingSchemaAction.Add ); ds.AcceptChanges(); // tried with and without this line
4
2253
by: Al | last post by:
I have this scenario: 1. XML file with schema and data is created from SQL Server tables. XML file contains 6 tables, some of them have rows, some of them are empty. 2. XML file is given to the person with Pocket PC. 3. XML file is used to populate DataSet on the Pocket PC. 4. User adds new rows, changes values, deletes some rows. 5. Altered dataset is saved back to XML file. 6. XML file is given back to the person who initially created...
1
2540
by: matt | last post by:
hello, i have a web app that allows users to query our oracle db and produce a dataset of report data. they then have the option to serialize this data and store it in the database. later, then can re-run the report and get fresh data. now, they would like to be able to compare the fresh data to the stored data, getting a break-down of added/deleted/changed rows. on the surface, this sounded plausible -- by deserializing the stored
5
16706
by: Mark Chambers | last post by:
Hi there, Can anyone explain the following (very) simple scenario. 1) I make an exact copy of my "DataSet" and delete one record from a given table (in the copy) 2) I invoke "DataSet.GetChanges()" on the above copy and pass the results to "DataSet.Merge()" on the original copy 3) If I now inspect the original copy, it shows that the record has *not* been deleted from the table. However, a call to "GetChanges()" does show my
5
1862
by: Franck | last post by:
how come unchanged always true even if data changed This code come from my saving button: ============================================ DataSet ds1 = new DataSet(); DataSet ds2 = new DataSet(); DataSet ds3 = new DataSet(); //Static Dataset which contain values when my form load
2
1859
by: Neil Chambers | last post by:
I am trying to get my head around dataset merging but despite a little research I could still use a pointer (or ten). Basically I want to perform an outer join operation on a dataset (created from a file operation) and the resulting sql query based on the contents of said dataset. Effectively I would end up with two dataset tables in my application. If I were writing this to action from two tables it would be thus: SELECT ds.id, db.*
1
6213
by: joproulx | last post by:
Hello all, Here is my problem: I am trying to merge 2 datasets but I don't want to overwrite rows that are already modified in my working dataset. Example: I have one Dataset with only one DataTable in it. The DataTable has these 2 columns: Column #1: Name="Id" Type=Int32 (Primary Key)
0
9687
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9541
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10252
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10231
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10027
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6805
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4141
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.