I get client data from MySql database and client object from web service.
I want to compare each value in a datatable with the values in an object, and if there is one field that is different, I want to perform some tasks.
I know I can get values from datatable with:
string mCompanyName = row["Company Name"].ToString();
string mCreatedDate = row["Created Date"].Tostring();
Then I get the values from the web service
string wsCompanyName = customer.companyName;
string wsCreatedDate = customer.createdDate;
There are about 50 fields and makes
if( mCompanyName != wsCompanyName & mCreatedDate != wsCreatedDate and so on..) (or similar)
{
//Do something
}
seems a little tedious and not very pleasant, so how do I do this? Is there a better way to list it and use some fancy LINQ?
Thanks in advance.
source
share