G
Guest
I have a method which takes two parameters.. and they both come from database.
I get error message when one of the parameter from the database contain null
value.
What do i need to check to prevent getting this error? how do i check for
null value?? how can i replace the null value with (0) zero to stop this
error?
Many thanks
Eerror message: Specified cast is not valid.
int DBBrandID =(int)((DbDataRecord)e.Item.DataItem)["BrandID"];
int DBModelID =(int)((DbDataRecord)e.Item.DataItem)["ModelID"];
lblMakeModel.Text = cs.getBrandModel(DBBrandID,DBModelID);
I get error message when one of the parameter from the database contain null
value.
What do i need to check to prevent getting this error? how do i check for
null value?? how can i replace the null value with (0) zero to stop this
error?
Many thanks
Eerror message: Specified cast is not valid.
int DBBrandID =(int)((DbDataRecord)e.Item.DataItem)["BrandID"];
int DBModelID =(int)((DbDataRecord)e.Item.DataItem)["ModelID"];
lblMakeModel.Text = cs.getBrandModel(DBBrandID,DBModelID);