|
VB.NET校验字符串是否是日期
'Validate for a date
Shared Function checkdate(ByVal thisvalue As String) As String
If Not IsDate(thisvalue) Then
checkdate = "NULL"
Else
checkdate = "'" & thisvalue & "'"
End If
Return checkdate
End Function ' END checkdate
VB.NET检查字符串是否是数字
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'Used to submit values to the database, check for empty value, replace w/ "NULL"
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Shared Function checkNumber(ByVal thisvalue As String) As String
If IsDBNull(thisvalue) Or Len(thisvalue) = 0 Or Not IsNumeric(thisvalue) Then
checkNumber = "NULL"
Else
checkNumber = thisvalue
End If
Return checkNumber
End Function ' END checkNumber
以上所述就是本文的全部内容了,希望大家能够喜欢。
您可能感兴趣的文章:- VB.net 查询获取数据库数据信息
- C#/VB.NET 在PDF中添加文件包(Portfolio)的方法
- vb.net操作注册表的方法分析【增加,修改,删除,查询】
- VB.NET调用MySQL存储过程并获得返回值的方法
- 在VB.NET应用中使用MySQL的方法
- VB.NET获取文件默认图标的方法
- C#、vb.net及SQL判断指定年份是否为闰年的方法
- C#中的除法运算符与VB.NET中的除法运算符
- 浅谈如何使用vb.net从数据库中提取数据
|