Advertisement

05.09.2008 at 07:15AM PDT, ID: 23389391
[x]
Attachment Details

Checking for Null in DateTime Field

Asked by beef137 in VB Database Programming, Microsoft Visual Basic.Net, VB Objects

Tags: Visual Basic, Visual Studio 2008

My app is erroring out on the code below...

Me.TableAdapter.Fill(Me.DataSet.Table, variable)
Dim row As DataSet.TableRow
row = DataSet.Table.Rows.Item(0)

If row.DateTimeField is DBNull.Value Then
Else
Me.DateTimePicker.value = row.DateTimeField
End If

It won't accept the "If row.DateTimeField is DBNull.Value Then" line. How can I check if the field is null?
Start Free Trial
 
Loading Advertisement...
 
[+][-]05.09.2008 at 07:25AM PDT, ID: 21533132

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.09.2008 at 07:28AM PDT, ID: 21533159

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.09.2008 at 07:29AM PDT, ID: 21533168

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.09.2008 at 07:35AM PDT, ID: 21533223

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.09.2008 at 07:42AM PDT, ID: 21533315

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.09.2008 at 07:48AM PDT, ID: 21533386

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: VB Database Programming, Microsoft Visual Basic.Net, VB Objects
Tags: Visual Basic, Visual Studio 2008
Sign Up Now!
Solution Provided By: VBRocks
Participating Experts: 3
Solution Grade: A
 
 
[+][-]05.09.2008 at 07:58AM PDT, ID: 21533502

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628