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'
Loading
Jaish MathewsPosted Apr 4, 2010, 12:43 PM
Change all field representation with square bracket, like
sqlDR["CustomerID"]
Jaish MathewsPosted Apr 5, 2010, 3:28 AM
Lennie KuahPosted Apr 4, 2010, 6:13 PM
Thank you very very much for your suggestions. It does fix my coding problems. You are awesome and generous in sharing information with me. I am so glad to meet you at his FORUM.
Thanks again.