ca guy

ca guy

  • NA
  • 13
  • 0

Override procedure..

Dec 27 2007 5:49 PM
Hi..
    I am new to c#. I want to write common procedure , when I pass database field as a parameter to procedure, if field has value just return the value or if field type is numeric then reurn 0 or if it is string then return ""..depending upon datatype of field being passed.
   Something like this considering CheckNull is the name of procedure..
     txtCode.Text=CheckNull(rs.Fields["ID"]);
     txtDate.Text=CheckNull(rs.Fields["SaleDate"]);
     txtYear.Text=CheckNull(rs.Fields["NoofYears"]);

Answers (9)