Conversion failed when converting datetime from character string

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

Page Design

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

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

</td>

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



Responses

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

Up
0
Down
What datatype is declared for "addProfile" function?

Change the first parameter datatype to string

Thanks

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

Login to post response