Click here to Skip to main content
15,888,454 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have two tables in a dataset and based on one table values i have to modify another table value and display it in the view

but the thing is Recommendations column is not available in DiagnosisFaultDescription1 it is in RecommendationDetails how can i change that row value?? Unfortunately there is no relation between 2 tables.

C#
DataTable dt = _dsexportData.Tables["DiagnosisFaultDescription1"];
DataTable dt1 = _dsexportData.Tables["RecommendationDetails"];

foreach (DataRow item in dt.Rows)
{
    if (item[0].ToString() == "Non-standard Fault Detected" && item[1].ToString() == "Moderate")
    {
        //how to change other table values here??

    }

}


Fault description Fault severity
Pump Imbalance Serious
Non-standard Fault Detected Moderate


Recommendations
Balance the pump
Contact Vibration specialist


for Non-standard Fault Detectedand modearate severity i have to show Contact viration specialist and for anyother combination i have to show blank.
Posted
Updated 18-Aug-14 19:38pm
v2
Comments
DamithSL 19-Aug-14 1:27am    
can you give sample data for dt, dt1 and final result you need to get?
Ashi0891 19-Aug-14 1:44am    
On what basis from table1 you want to modify data in table2?
Chris Ross 2 19-Aug-14 5:28am    
ARe the rows in tables 1 & 2 correlated .. such that decisions about row X in table 1 lead to a data change in row X of table 2? If so, I would recommend using a for () loop and index, not a foreach loop.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900