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
Zimbini Walaza
NA
16
0
BeginLoadData?????
Sep 18 2008 12:00 AM
The following code is supposed to be comparing two datasets and then load the rows that are not duplicates into a third datatable.Instead it repeats the rows that are already in the database(making more duplicates).Could someone tell me what i am doing wrong.
foreach (DataRow parentrow in dsImport.Tables[2].Rows)
{
DataRow[] childrows = parentrow.GetChildRows(r);
if (childrows == null || childrows.Length == 0)
dtImport.LoadDataRow(parentrow.ItemArray, true);
}
foreach (DataRow databaseRow in dsImport.Tables["StudentModule"].Rows)
{
foreach (DataRow spreadRow in dsImport.Tables["Sheet1$"].Rows)
{
if (spreadRow != databaseRow)
{
dtImport.BeginLoadData();
}
}
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
return dtImport
Reply
Answers (
0
)
How do I detect changes in a form and promt user to save before closing?
How can I create a search function with a textbox