944,047 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 6977
  • VB.NET RSS
Apr 6th, 2007
0

Comparing Two Datasets

Expand Post »
hai, i have two datasets which contains table values.the process is to compare the two datasets (DS1 and DS2) whether its equal or not...help us plz...thanks in advance.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
karan_21584 is offline Offline
32 posts
since Mar 2007
Mar 27th, 2008
0

Re: Comparing Two Datasets

Try this.In my ex.both datasets contain one field each.For multiple fields you have to change code a bit.



foreach (DataRow row in ds.Tables[0].Rows)
{
foreach (DataRow row1 in ds1.Tables[0].Rows)
{
if (row != row1)
{
if (ListBox1.Items.Count == 0)
{
ListBox1.Items.Add(new ListItem(row.ItemArray.GetValue(0).ToString()));
}
else
{
for (int i = 0; i < ListBox1.Items.Count; i++)
{



if (row.ItemArray.GetValue(0).ToString() != ListBox1.Items[i].Value)
if (i == ListBox1.Items.Count - 1)
{ ListBox1.Items.Add(new ListItem(row.ItemArray.GetValue(0).ToString())); }




}
}

}
}
}
Reputation Points: 10
Solved Threads: 0
Newbie Poster
nrar is offline Offline
1 posts
since Mar 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: Load Report Failed in Crystal Report using Datasets
Next Thread in VB.NET Forum Timeline: Passing Parameters to Linked Subreports





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC