如何删除数据表的数据列的值? [英] How to delete values of a datacolumn of datatable ?

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

问题描述

大家好!
我有一个包含3列的数据表:A,B,C和5行.
我想删除A列的值.我该怎么办,请帮帮我!!!!
非常感谢

Hi all!
I have a datatable with 3 columns : A, B, C and 5 rows.
I want to delete value of the A column. How can I do that, please help me!!!!
Thanks a lot

推荐答案

您可以遍历行并将所需列的值设置为null.像这样的东西:
You can loop through the rows and set the required column''s value to null. Something like this:
foreach (DataRow row in table.Rows)
            {
                row["A"] = null;
            }



希望有帮助!



Hope that helps!


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

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