SqldataReader invalid read when column is emtpy

Chinavo

Member
Joined
Jul 16, 2008
Messages
16
Programming Experience
1-3
Hi

I do many sql queries in my application using SqlDataReader.

There are some columns in certain tables that can be empty.
Now when read out information out of an empty column using
sqlDataReader i get an error massage that the read was invalid
coz there are no dates.

How can i avoid that?? do i have to use try catch for every
single read?? Is there no other way??

thanx for the help.

chinavo
 
If you mean SqlDataReader.GetDateTime Method then help says this:
Call IsDBNull to check for null values before calling this method.
 
Back
Top