Hi Chandra,
If I understand correctly, you're trying to update values in the second table, based on values in the first table("DiagnosisFaultDescription1" and "RecommendationDetails") -- however the second table doesn't have column names (I'm assuming the table schema is the same in both tables or has overlapping columns. If neither is the case then I don't see the purpose in what you're doing).
DataTable dt = _dsexportData.Tables["DiagnosisFaultDescription1"];
DataTable dt1 = _dsexportData.Tables["RecommendationDetails"];
var hasRecommendations = dt1.Columns.Contains("Recommendations");
var index = dt1.Columns.IndexOf("Recommendations");
for (int i = 0; i < dt.Rows.Count; i++)
{
var item = dt.Rows[i];
if (item[0].ToString() == "Non-standard Fault Detected")
{
if (hasRecommendations)
{
dt1.Rows[i]["Recommendations"] = "Contact vibration Specialist";
dt1.Rows[i][index] = "Contact vibration Specialist";
}
}
}
I can provide a better answer if you can clarify your question and if possible, provide more schema detail. Otherwise, try to explain what you'd like to occur as the final result.
Hope this helps,
Code.Combustion