我创建了一个数据表格,它有3列产品编号、产品名称和产品价格
Datatable table= new DataTable("Product");
table.Columns.Add("Product_id", typeof(int));
table.Columns.Add("Product_name", typeof(string));
table.Columns.Add("Product_price", typeof(string));
table.Rows.Add(1, "abc", "100");
table.Rows.Add(2, "xyz", "200");
现在我想通过索引查找并更新该行。
比如说
我想将 Product_name 列的值更改为“cde”,其 Product_id 列的值为 2。