I have finish perfectly coding Register Page, Login and now the UpdateCustomer page has errors - Background info : I'm using Microsoft Access as data source
LabelState.Text = (string)Session["sState"];
LabelPostalCode.Text = (string)Session["sPostalCode"];
LabelContactNumber.Text = (string)Session["sContactNumber"];
LabelEmail.Text = (string)Session["sEmail"];
LabelPassword.Text = (string)Session["sPassword"];
Everything here is fine except LabelContactNumber.Text = (string)Session["sContactNumber"]
.
I believe it is because only ContactNumber in Access is set as Int the rest is Text therefore there's no error when I use (string).
Problem : it is failing because you are assigning the Integer type into String. here you need to use explicit conversion to convert the Integer type into String type.
Solution : if you want to check wether contact number can be parsed to int or not before assigning it into TextBox use
TryParse
method