TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Lennie Kuah
NA
29
0
C#.Net2008 Check DBNull using IF
Apr 4 2010 6:12 AM
Hi there,
I am trying to NULL value from DataReader date using C#.NEt 2008 but it generate error message from the coding list below
if (sqlDR(
"CustomerID"
) != System.
DBNull
.Value) { this.txtCustID.Text = sqlDR(
"CustomerID"
); }
if (sqlDR(
"OrderDate"
) != System.
DBNull
.Value) { this.txtOrderDate.Text = sqlDR(
"OrderDate"
); }
if (sqlDR(
"ReqDate"
) != System.
DBNull
.Value) { this.txtRequiredDate.Text = sqlDR(
"ReqDate"
); }
if (sqlDR(
"ShipDate"
) != System.
DBNull
.Value) { this.txtShipDate.Text = sqlDR(
"ShipDate"
); }
if (sqlDR(
"TransFee"
) != System.
DBNull
.Value) { this.txtFreight.Text = sqlDR(
"TransFee"
); }
This is the error message:
Error 1 FrmOrderMaint.sqlDR' is a 'field' but is used like a 'method'
Reply
Answers (
3
)
Conver Python Code to C# Code
C#.Net2008 Problem trying to retrieve data from DataGridView