Dataset Merge

  • Thread starter Thread starter Ruslan Shlain
  • Start date Start date
R

Ruslan Shlain

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;
 
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.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top