System.InvalidCastException

Discussion in 'ASP .Net' started by Brian Conway, May 18, 2004.

  1. Brian Conway

    Brian Conway Guest

    Hope someone can help. I am trying to get a submit button working and
    getting this error now System.InvalidCastException: Object must implement
    IConvertible. This is showing up on the ExecuteNonQuery line. Below is the
    code that I have in my Page_load. I also have no idea of what code I would
    use in the Submit_Click event to get the insert to work. Any help would be
    appreciated

    OleDbConnection conn = new
    OleDbConnection("Provider=OraOLEDB.Oracle.1;Persist Security
    Info=False;"+"User ID=conference;Password=conf00;Data
    Source=ntdrp001.world;");

    OleDbCommand command = new OleDbCommand("CONF-REQUEST_INSERT", conn);

    command.CommandType = CommandType.StoredProcedure;

    command.Parameters.Add("DropDownList1", OleDbType.VarChar).Value =
    DropDownList1;

    command.Parameters.Add("DropDownList2", OleDbType.VarChar).Value =
    DropDownList2;

    command.Parameters.Add("txtEStartDate", OleDbType.Date).Value =
    txtEStartDate;

    command.Parameters.Add("txtEEndDate", OleDbType.Date).Value = txtEEndDate;

    command.Parameters.Add("txtEStartTime", OleDbType.Numeric).Value =
    txtEStartTime;

    command.Parameters.Add("txtEEndTime", OleDbType.Numeric).Value =
    txtEEndTime;

    command.Parameters.Add("txtEventName", OleDbType.VarChar).Value =
    txtEventName;

    command.Parameters.Add("txtEventSize", OleDbType.Numeric).Value =
    txtEventSize;

    command.Parameters.Add("txtSStartDate", OleDbType.Date).Value =
    txtSStartDate;

    command.Parameters.Add("txtSStartTime", OleDbType.Numeric).Value =
    txtSStartTime;

    command.Parameters.Add("txtEventDescription", OleDbType.VarChar).Value =
    txtEventDescription;

    command.Parameters.Add("txtSpecialRequirements", OleDbType.VarChar).Value =
    txtSpecialRequirements;

    conn.Open();

    int rows = command.ExecuteNonQuery();

    conn.Close();
     
    Brian Conway, May 18, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Floela
    Replies:
    3
    Views:
    574
    Jon Skeet
    Jul 10, 2003
  2. Arjen
    Replies:
    1
    Views:
    7,772
    Carl Prothman [MVP]
    Aug 6, 2003
  3. Miguel Angel Dinelli
    Replies:
    1
    Views:
    448
    Chris Jackson
    Nov 13, 2003
  4. Roy Lawson
    Replies:
    12
    Views:
    5,190
  5. Biva
    Replies:
    6
    Views:
    2,567
    sqlgirl
    Jan 5, 2005
Loading...

Share This Page