System.InvalidCastException

B

Brian Conway

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

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top