473,396 Members | 1,785 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,396 software developers and data experts.

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_strdatabaseconConn);

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

daSQLDA.Fill(dsDS);

dsDS.Merge(dsMain,true);

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

--
Ruslan Shlain
nAlliance Corporation
www.nAlliance.com
Nov 15 '05 #1
2 3597
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*****@hotmail.com> wrote in message
news:OR*************@TK2MSFTNGP12.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_strdatabaseconConn);

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

daSQLDA.Fill(dsDS);

dsDS.Merge(dsMain,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*****@hotmail.com> wrote in message
news:e$**************@TK2MSFTNGP12.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*****@hotmail.com> wrote in message
news:OR*************@TK2MSFTNGP12.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_strdatabaseconConn);

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

daSQLDA.Fill(dsDS);

dsDS.Merge(dsMain,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
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...
3
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...
2
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...
2
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(...
4
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...
1
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...
5
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...
5
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...
2
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...
1
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...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.