【发布时间】:2013-11-06 22:06:32
【问题描述】:
我已经创建了一个数据表。它有 3 列 Product_id、Product_name 和 Product_price
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 列的值更改为具有 Product_id 列值的“cde”:2。
【问题讨论】:
-
请编辑您的问题以包含您迄今为止尝试过的代码。谢谢。