By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,013 Members | 1,210 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,013 IT Pros & Developers. It's quick & easy.

Dataset Merge

P: n/a

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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.