Conversion failed when converting datetime from character string

Posted by Self-Innovator under ASP.NET AJAX on 10/25/2012 | Points: 10 | Views : 1998 | Status : [Member] | Replies : 1
how to solve this error?

Page Design

<asp:TextBox ID="txtDateOfBirth" runat="server" ></asp:TextBox>

<cc1:CalendarExtender ID="txtDateOfBirth_CalendarExtender" runat="server"
Enabled="True" TargetControlID="txtDateOfBirth">


Code Behind

protected void btnsave_Click(object sender, EventArgs e)
Admin aad = new Admin();
aad.addProfile(txtDateOfBirth.Text, Convert.ToInt32(txtAge.Text.Trim());

Join Hands Change lives
Thanks & Regards
Straight Edge Society


Posted by: Seng2hs on: 10/25/2012 [Member] Starter | Points: 25

What datatype is declared for "addProfile" function?

Change the first parameter datatype to string


Self-Innovator, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response