This is a migrated thread and some comments may be shown as answers.

Failed to convert parameter value

1 Answer 52 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
igloo3232
Top achievements
Rank 1
igloo3232 asked on 01 Oct 2008, 06:45 PM
Debugging my first web application using a DateTimePicker Rad control and I continue to get "Failed to convert parameter value from a DatePickingInput to a DateTime" errors. Any ideas on how to proceed?

Here's the code snippet:

cmd =

new SqlCommand("INSERT INTO Act (Title, StartDate, EndDate VALUES (@Title, @StartDate, @EndDate", conn);

cmd.Parameters.Add(

"Title", SqlDbType.Char, 50).Value = ActTitle.Text;

cmd.Parameters.Add(

"StartDate", SqlDbType.DateTime).Value = ActStart.DateInput;

cmd.Parameters.Add(

"EndDate", SqlDbType.DateTime).Value = ActEnd.DateInput;

conn.Open();

cmd.ExecuteNonQuery();

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 02 Oct 2008, 06:12 AM
Hi igloo3232,

You should use SelectedDate property.

Best wishes,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Calendar
Asked by
igloo3232
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or