QUOTE(silvestrelsl @ Feb 21 2011, 04:10 PM)
It is not really complicated to compare 2 data grid view with same row position.
I believe you have access to both dataset.
The code is simple as below:
DataSet ds = datagridview1.DataSource; [COLOR=red]<<<<This part[/COLOR]
DataSet ds2 = datagridview2.DataSource;
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
for (int j = 0; j < ds.Tables[0].Columns.Count; j++)
{
if (ds.Tables[0].Rows[i][j].ToString() == ds2.Tables[0].Rows[i][j].ToString())
return true;
}
}
Be warn, need some more tweaking if you have a lot of records in the dataset.
I'm sorry that I'm so weak I can't do it. Needed thorough guide pls, in VB2010. How to do the above part ? assuming my values were inserted directly into DGV without using datatsources..I believe you have access to both dataset.
The code is simple as below:
CODE
DataSet ds = datagridview1.DataSource; [COLOR=red]<<<<This part[/COLOR]
DataSet ds2 = datagridview2.DataSource;
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
for (int j = 0; j < ds.Tables[0].Columns.Count; j++)
{
if (ds.Tables[0].Rows[i][j].ToString() == ds2.Tables[0].Rows[i][j].ToString())
return true;
}
}
Be warn, need some more tweaking if you have a lot of records in the dataset.
Feb 13 2012, 05:28 PM

Quote
0.0153sec
0.41
6 queries
GZIP Disabled