PONO GrossRate
123 10
456 20
892 63
datatable contains:
PONo GrossRate
123 11
456 20
892 63
So question is to compare them & display the following result:(Changed GrossRate)
PONO GrossRate
123 111
help me...
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sukesh MarlaPosted Aug 21, 2012, 1:33 PM
cHECKK THIS IS CORRECT ANSWER IF IT HELPED
Sukesh MarlaPosted Aug 22, 2012, 12:17 PM
Gopal MahadakPosted Aug 22, 2012, 12:12 AM
Gopal MahadakPosted Aug 21, 2012, 7:35 AM
Sukesh MarlaPosted Aug 21, 2012, 6:04 AM
First take your database table records into C# DataTable(MyDataTable)
and then Compare two them as
DataTable Common=MyDataTable.clone()
foreach(DataRow Dr in Datatabl1.Rows)
{
foreach(DataRow Dr2 in MyDataTable.Rows)
{
if(Dr["Col1"]==Dr2["Col1"] && Dr["Col2"]==Dr2["Col2"])
{
DataRow DrTemp=Common.newRow();
DrTemp["Col1"]=Dr["Col1"];
DrTemp["Col2"]=Dr["Col2"];
Common.Rows.add(DrTemp);
}
}
}
Hope this helped, Check this is correct answer