There are 2 identical tables with same name on different servers. Let say Table1 and Table2. I need to compare the tables and have to report if any field value is not matching. I'm using C# and Entity framework. I was able to retrieve the rows of the tables(recordsets) but how can i check each and every field of the datarow. The number and name of columns in both tables are same and are in same order. There are such several tables. I need to fetch the field values from each table and compare with same field from another table. How can i retrieve field value using EF and Linq. If its complex using EF, is there any other approach to access tables and compare field values.
Task to perform: Compare Table1.Row[1]Column[2].value with Table2.Row[1]Column[2].value
var query1 = (from prod in con1.Products
select new { }).ToList();
var query2 = (from prod in con2.Products
select new { }).ToList();
for (int i = 0; i < query1.Count; i++)
{
Console.WriteLine(query1.GetType());
if (query1[i] != query2[i])
{
Console.WriteLine("Data not matching at");
}
}