Hi,
I am using the following code to check the common message Ids of 3 excel sheets columns
i = 2;
foreach (DataRow row in lstDS[2].Tables[0].Rows)
{
string fieldFromDB = row[1].ToString();
string FromDB = row[2].ToString();
foreach (DataRow row1 in lstDS[0].Tables[0].Rows)
{
string fieldFromDB1 = row1[1].ToString();
if (fieldFromDB == fieldFromDB1)
{
foreach (DataRow row2 in lstDS[1].Tables[0].Rows)
{
string fieldFromDB2 = row2[1].ToString();
if (fieldFromDB1 == fieldFromDB2)
{
xlWorkSheet4.Cells[i, 1] = row[1];
xlWorkSheet4.Cells[i, 2] = row[13];
xlWorkSheet4.Cells[i, 3] = row1[13];
xlWorkSheet4.Cells[i, 4] = row2[13];
xlWorkSheet4.Cells[i, 5] = 10.ToString();
i++;
}
}
}
}
}
This code is working fine
Now I need to check the columns of 2 excel sheets for the common message Id and from those I need to eliminate common message Id of 3 excel sheet columns
I am trying something like this in the following code, but this includes the common message Ids of the 3 excel sheets also
i = 2;
foreach (DataRow row in lstDS[2].Tables[0].Rows)
{
string fieldFromDB = row[1].ToString();
string FromDB = row[2].ToString();
foreach (DataRow row1 in lstDS[0].Tables[0].Rows)
{
string fieldFromDB1 = row1[1].ToString();
if (fieldFromDB == fieldFromDB1)
{
}
}
}
How can I exclude the common message Ids of 3 excel sheets from this code snippet
Thanks
John