473,385 Members | 1,593 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

System.InvalidCastException

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();
Jul 21 '05 #1
1 1645
Brian Conway <Br**********@qwest.com> wrote:
Hope someone can help.


<snip>

Please see my response on the C# group - and please consider not multi-
posting in future, as it fragments discussions. If you *must* post to
more than one group (and in this case, the ADO.NET group would probably
have been the best one to post to) please consider cross-posting
instead.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: bob scola | last post by:
I have a csharp, VS 2003 solution for a winform application The application uses an object called a "matter" and the class is defined in matter.cs. I can load matter objects into a combobox ...
1
by: Hifni Shahzard | last post by:
Hi, I got a stored procedure, where it returns a value. But if I execute it. It gives an error as "Invalid cast from System.Int32 to System.Byte.". To make clear how do I execute this, below I'm...
4
by: DOTNET | last post by:
Hi, Anybody help me regarding this error: I am assigning the values to the session variables when the button is clicked and passing these session variables to the next page and when I am...
0
by: QA | last post by:
I am using a Business Scorecard Accelarator in a Sharepoint Portal 2003 using SQL Server 2005 I am getting the following error: Error,5/7/2005 10:50:14 AM,580,AUE1\Administrator,"Specified cast is...
1
by: Marc | last post by:
Hi! I'm working with a C# client that calls a php web service. I've created a wrapper to call the service using .NET wsdl tool (adding a web reference). The call to the server works fine, it...
2
by: John Smith | last post by:
I'm writing webervice client using .Net 2.0. I have this class: public class MyWebService : SoapHttpClientProtocol { public XmlDocument validate(string url, XmlDocument xmlDocument) {...
1
by: Ratz | last post by:
Hello everyone! I'm new to this Forum! I've spent about 56 hours trying to solve a .NET VB Runtime error while Using a program.Ive contacted the developer of the program and he could not figure out...
8
by: Gamma | last post by:
I'm trying to inherit subclass from System.Diagnostics.Process, but whenever I cast a "Process" object to it's subclass, I encounter an exception "System.InvalidCastException" ("Specified cast is...
8
by: =?Utf-8?B?YXVsZGg=?= | last post by:
i trying to collect windows services. i'm getting inconsistencies. the collection works every time locally. but remote collection yields different result depending on my lab environment. 1) in...
4
by: rsdev | last post by:
Hi, I have an InvalidCastException which is completely puzzling me. I have checked all the members in the stored procedure against my data provider and seems to be ok. Also in the stack trace it...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.