[Solved] C#-How to update a first row in DataTable based on dictionary values [closed]

[ad_1]

You can try this one.

var dictionary = new Dictionary<string, int>();
    dictionary.Add("pay_month", 2);
    dictionary.Add("pay_year", 1);
    if (dt.Rows.Count > 0) 
     {
        DataRow row = dt.Rows[0];

        row["Month"]=dictionary["pay_month"];
        row["year"]=dictionary["pay_year"];
     }

[ad_2]

solved C#-How to update a first row in DataTable based on dictionary values [closed]