Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > System.InvalidCastException

Reply
Thread Tools

System.InvalidCastException

 
 
Brian Conway
Guest
Posts: n/a
 
      05-18-2004
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;Persis t 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();




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments