How to Edit a row in the datatable

前端 未结 6 1060
说谎
说谎 2020-12-05 18:46

I have created a data table. It has 3 column Product_id, Product_name and Product_price

    Datatable tabl         


        
6条回答
  •  甜味超标
    2020-12-05 19:07

    Try this I am also not 100 % sure

            for( int i = 0 ;i< dt.Rows.Count; i++)
            {
               If(dt.Rows[i].Product_id == 2)
               {
                  dt.Rows[i].Columns["Product_name"].ColumnName = "cde";
               }
            }
    

提交回复
热议问题