空值验证 [英] Null value validation
本文介绍了空值验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在使用rad网格的所有项目中都晚安,我如何才能验证update命令和insert命令中的空值.请帮助我一个人.
在此先感谢
由
Meganathan
Good Evening to all in my project i am using rad grid how can i validate the null values in update command and insert command.Please help me any one.
Thanks in advance
By
Meganathan
推荐答案
使用静态方法"bool System.String.IsNullOrEmpty(字符串值)",如下所示:
Use the static method "bool System.String.IsNullOrEmpty(string value)", something like this:
string text = SomeControl.Text;
if (String.IsNullOrEmpty(text))
{
// Warn user or whatever...
}
else
{
// use string...
}
这篇关于空值验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文