Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > dbnull

Reply
Thread Tools

dbnull

 
 
segue
Guest
Posts: n/a
 
      01-28-2008

How would I run an if statement for dbnull?

Much thanks.

Dim reader As OdbcDataReader = select_command.ExecuteReader()
Do While (reader.Read())

If reader.Item("somedbfield") <> DBNull.Value Then


 
Reply With Quote
 
 
 
 
Milosz Skalecki [MCAD]
Guest
Posts: n/a
 
      01-29-2008
Hi there,

Yep, as well as:
If Not TypeOf reader("somedbfield") Is DbNull then
If Not reader.IsDbNull(reader.GetOrdinal("somedbfield")) then
--
Milosz


"segue" wrote:

>
> How would I run an if statement for dbnull?
>
> Much thanks.
>
> Dim reader As OdbcDataReader = select_command.ExecuteReader()
> Do While (reader.Read())
>
> If reader.Item("somedbfield") <> DBNull.Value Then
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange DBNULL Error - Please Help! Martin ASP .Net 2 02-02-2004 09:23 AM
Cast from type 'DBNull' to type 'String' is not valid. Elmo Watson ASP .Net 3 12-25-2003 03:30 AM
Public member 'length' on type 'DBNull' not found. dave ASP .Net 1 11-26-2003 06:59 PM
Adding a DBNull value to the database Boris Zakharin ASP .Net 0 08-27-2003 12:53 AM
Question: Best way to handle DBNULL in datareaders Ravikanth[MVP] ASP .Net 6 07-18-2003 10:51 AM



Advertisments