C# DB Null?

A

Adam J Knight

Hi all,

How can i determine if a reader record is DBNull is C#???
What reference do i need?

if(rdrExam["OutcomeID"].??)
{
Response.Write("Here I am");
}

Cheers,
Adam
 
P

Patrick.O.Ige

Hi Adam how is the weather over there..Have u tried...if
(!IsDBNull(rdrExam.GetValue(4))) {
Response.Write("Here I am");}
 
J

john smith

Patrick.O.Ige said:
Hi Adam how is the weather over there..Have u tried...if
(!IsDBNull(rdrExam.GetValue(4))) {
Response.Write("Here I am");}
Patrick "Adam J Knight said:
Hi all,

How can i determine if a reader record is DBNull is C#???
What reference do i need?

if(rdrExam["OutcomeID"].??)
{
Response.Write("Here I am");
}

Cheers,
Adam

This is faster than IsDBNull(), however both ways should work...

if (!rdrExam["OutcomeID"].Equals(System.DBNull.Value))
{
Response.Write("Here I am");
}
 
K

Karl Seguin [MVP]

if (rd["OutcomeId"] != DBNull.Value)
{
}

Karl

--
http://www.openmymind.net/



john smith said:
Patrick.O.Ige said:
Hi Adam how is the weather over there..Have u tried...if
(!IsDBNull(rdrExam.GetValue(4))) {
Response.Write("Here I am");}
Patrick "Adam J Knight said:
Hi all,

How can i determine if a reader record is DBNull is C#???
What reference do i need?

if(rdrExam["OutcomeID"].??)
{
Response.Write("Here I am");
}

Cheers,
Adam

This is faster than IsDBNull(), however both ways should work...

if (!rdrExam["OutcomeID"].Equals(System.DBNull.Value))
{
Response.Write("Here I am");
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top