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
 
Back
Top