Re: Error message - Can someone check my code?
- From: "Herfried K. Wagner [MVP]" <hirf-spam-me-here@xxxxxx>
- Date: Mon, 20 Apr 2009 21:20:54 +0200
"Sheldon" <Sheldon@xxxxxxxxxxxxxxxxxxxxxxxxx> schrieb:
The following code is returning the error "Invalid cast exception.
Conversion from type DBNull to type Date is not valid." It will return the
recordset if DateWritten has a date in it, but if it does not, I get the
error. Any help will be appreciated1
<snip>
If dsEmailSearch.Tables("tblEmailAdd").Rows(currentEmailRow)("DateWritten")
Is Nothing = True Then
=> 'If ... Is DBNull.Value Then' or 'If IsDBNull(...) Then'.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
.
- References:
- Error message - Can someone check my code?
- From: Sheldon
- Error message - Can someone check my code?
- Prev by Date: Re: MySQL used with VB .NET 1.0
- Next by Date: Re: VB.NET 2008 not backward compatable?
- Previous by thread: Re: Error message - Can someone check my code?
- Next by thread: How Do I Put a Control On Top of Everything Else?
- Index(es):