如何将字符串变量分配给datatable?

时间:2011-08-03 09:37:36

标签: c# datatable

我必须将字符串变量分配给datatable。 dtHistoryList.Rows[1].ItemArray[3] = txtNaiyo.Text; 它不起作用。请帮助我。

1 个答案:

答案 0 :(得分:1)

使用索引器

dtHistoryList.Rows[1][3] = txtNaiyo.Text

dtHistoryList.Rows[1]["rowName"] = txtNaiyo.Text