TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Aamir Khan
NA
277
440k
How to copy from one table to another table using dataset
Nov 12 2011 2:21 AM
hi frnds,
a query how to get data from one dataset to another dataset and update it using dataadapter.
my code is like this.
DataSet ds = new DataSet();
DataSet ds1 = new DataSet();
SqlCommandBuilder Ole_Build;
dap = new SqlDataAdapter("select * from " + tblSource + " where " + Date + " between '" + Convert.ToDateTime(FromDate).ToString("yyyy/MM/dd") + "' and '" + Convert.ToDateTime(ToDate).ToString("yyyy/MM/dd") + "'", con1);
dap.Fill(ds, tblSource);
SqlDataAdapter dap1 = new SqlDataAdapter("select * from " + tblDestination + " ", con);
Ole_Build = new SqlCommandBuilder(dap1);
dap1.AcceptChangesDuringFill = true;
dap1.AcceptChangesDuringUpdate = true;
dap1.Fill(ds1, tblDestination);
DataSet dsnew = new DataSet();
ds1 = ds.Copy();
dap1.Update(ds1, tblDestination);
but it is not getting update
thanks & regrads,
aamir
Reply
Answers (
4
)
How to use tab controls dynamically in c#
Autogeneration of id in gridview