|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
If Then statement with Null Value
Does anyone know how to write the following statement correctly.
If [FieldName] is Null Then [DoThis] In VBA it was - If IsNull(FieldName) Then [Do This] Thanks |
|
#2
|
||||
|
||||
|
What happens when you use that logic, do you get an error?
What version of VB are you using? In VB6 your syntax is fine: Code:
If IsNull(rs.Fields(0)) Then
'the field is null!!
End If
If you are using .Net I think the command has been replaced with IsDBNull: Code:
If IsDBNull(myDataSet.Tables(0).Item(0)) Then
'the field is null!!
End If
Last edited by sync_or_swim : March 20th, 2008 at 05:13 AM. |
|
#3
|
|||
|
|||
|
Code:
if (field name).lenght > 1 then this may not be 100% correct but close very close |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > If Then statement with Null Value |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|
|