16
Answers

How do I copy access datatable from one dataset to another

Ask a question
I have two datasets (ds1 and ds2). Table1 belongs to ds1. I'd like to copy it (and rename it) and add it to ds2. When I run my program, there is no errors, but there is no dt2 in database2.mdb. 


DataTable dt1 =ds1.Table1;
 DataTable dt2 = new DataTable();
          
            dt2 = dt1.Copy();

ds2.Tables.Add(dt2);
 ds2.AcceptChanges();

Answers (16)