G
Guest
System.InvalidCastException: Specified cast is not valid.
hi i am received that error below is my code
result = new CustID(Convert.ToString(reader["CustID"]),
Line 57:
(DateTime)reader["BirthDate"],Convert.ToString(reader["Name"]),
Convert.ToString(reader["Sex"]), (Byte)reader["NameFormatCodeOri"],
Convert.ToString(reader["Address"]),
Convert.ToString(reader["PostCode"]));
First error was can not convert dbnull to string then i used
Convert.tostring and now i am getting that error not with all record but with
some records i assume dbnull value created some problem
thanks
hi i am received that error below is my code
result = new CustID(Convert.ToString(reader["CustID"]),
Line 57:
(DateTime)reader["BirthDate"],Convert.ToString(reader["Name"]),
Convert.ToString(reader["Sex"]), (Byte)reader["NameFormatCodeOri"],
Convert.ToString(reader["Address"]),
Convert.ToString(reader["PostCode"]));
First error was can not convert dbnull to string then i used
Convert.tostring and now i am getting that error not with all record but with
some records i assume dbnull value created some problem
thanks