如何更新数据表的单元格值? [英] How can i update cell value of data table?

查看:141
本文介绍了如何更新数据表的单元格值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何更新数据表的单元格值

How can i update cell value of data table

if ((sr_no == "") && (customer_name != ""))
{
  string contact_no = SheetData.Tables[0].Rows[row].ItemArray[3].ToString();
  Records.Rows[0].ItemArray[2]                                      
}

i要更新datatable的单元格(如果下一行中的contact_no不可用)

i want to update cell of datatable if contact_no fround in next row

推荐答案

如果记录是您的 DataTable 执行以下操作:

if Records is your DataTable do this:

Records.Rows[i][j] = value;

这并不能回答整个问题,但向您展示了如何在DataTable单元格中设置值。

this does not answer the whole question but shows you how to set a value in a DataTable "cell".

您使用的是 ItemArray ,因为一旦有了正确的行,就可以直接访问它具有 []

you are using the ItemArray which is not needed because once you have the right Row you can simply access its columns withh []

的列,您可以详细说明并根据此提示找出最终的解决方案。

you can elaborate more and find out the final solution based on this hint.

这篇关于如何更新数据表的单元格值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆