如何检查数据表中的行是否有数据? [英] How to check if the row has data or not in the DataTable?

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

问题描述

嘿,

如何检查数据表中的行是否有数据?例如,我的行是:姓名/年龄.我尝试使用此代码:

How to check if the row has data or not in the datatable? for example my rows are : Name / Age. I tried to work with this code:

If Row("Name") or Row("Age") = "" then else AddNewRows()

如果结束

但是它不起作用,并且给我错误使用新关键字创建对象距离"

But it didn't work, and it gives me error "Use the new keyword to create an object distance"

有帮助吗?
问候

Any help?
Greetings,

约翰.

推荐答案

DataTable行可以用整数而不是字符串建立索引.

A DataTable Rows can be indexed with an Integer and not a String.

您可能是要检查行的列是否为空吗?

Are you maybe meaning to check if the column of a row is empty?

请发布定义并填充数据表的代码.

Please post the code that defines and fills the datatable.


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

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