Failed to convert parameter value

2 posts, 0 answers
  1. igloo3232
    igloo3232 avatar
    1 posts
    Member since:
    Jul 2006

    Posted 01 Oct 2008 Link to this post

    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();

  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 02 Oct 2008 Link to this post

    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.
Back to Top