DateTimepIcker-Error
-
dtpFromDate & dtpTodate are DateTimepickers and a TextBox txtNoofDays
private void dtpFromDate_ValueChanged(object sender, eventArgs e)
{
double value=Convert.ToDouble(txtNoOfdays.Text);
dtpToDate.Value=dtpFromDate.Value.AddDays(value);
}Here I got the error at--> //double value ---- Input string was not in correct format How to resolve It.
-
dtpFromDate & dtpTodate are DateTimepickers and a TextBox txtNoofDays
private void dtpFromDate_ValueChanged(object sender, eventArgs e)
{
double value=Convert.ToDouble(txtNoOfdays.Text);
dtpToDate.Value=dtpFromDate.Value.AddDays(value);
}Here I got the error at--> //double value ---- Input string was not in correct format How to resolve It.
-
dtpFromDate & dtpTodate are DateTimepickers and a TextBox txtNoofDays
private void dtpFromDate_ValueChanged(object sender, eventArgs e)
{
double value=Convert.ToDouble(txtNoOfdays.Text);
dtpToDate.Value=dtpFromDate.Value.AddDays(value);
}Here I got the error at--> //double value ---- Input string was not in correct format How to resolve It.
The problem is in First statement double value=Convert.ToDouble(txtNoOfdays.Text); The Convert.ToDouble() function is not getting the correct input to convert. Like there can be nothing in the text box or there can be a space or any other character which is throwing error that the string is not in correct format. Regards, Kaushal Arora