473,405 Members | 2,334 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,405 software developers and data experts.

Object must implement IConvertible.

This is a question from a confused newbe.I have an oldDbCommand component
called oleDbCmdAddDemoReq and an oldDbConnection called oleDbConDemoReq on a
web form. I have the following code:

oleDbConDemoReq.Open();
oleDbCmdAddDemoReq.ExecuteNonQuery();
oleDbConDemoReq.Close();

I get this error message:

Object must implement IConvertible.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.InvalidCastException: Object must implement
IConvertible.

The error is comming form the ExecuteNonQuery command. I don't understand
what I am doing wrong.
Nov 15 '05 #1
2 11337
Bill, what is oleDbCmdAddDemoReq set up to do? Is it trying to return a
value? Does it have parameters? What is probably happening is that the
query has parameters and it is not able to convert to the requested format
from whatever value you are setting it to. If you want to post the code
that sets up the query we can probably help more.

--
Greg Ewing [MVP]
http://www.citidc.com

"Bill Cart" <bc***@morpc.RemoveThis.org> wrote in message
news:#N**************@TK2MSFTNGP11.phx.gbl...
This is a question from a confused newbe.I have an oldDbCommand component
called oleDbCmdAddDemoReq and an oldDbConnection called oleDbConDemoReq on a web form. I have the following code:

oleDbConDemoReq.Open();
oleDbCmdAddDemoReq.ExecuteNonQuery();
oleDbConDemoReq.Close();

I get this error message:

Object must implement IConvertible.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.InvalidCastException: Object must implement
IConvertible.

The error is comming form the ExecuteNonQuery command. I don't understand
what I am doing wrong.

Nov 15 '05 #2
Yes it does have parameters and that seems to be what the problem was. The
error message did not give me much of a clue as to what the real problem
was.

I think that a lot of the problem is that I am using C# standard. If I
understand it correctly this can only work with oldDb. The problem is that I
have MSDE installed and when I drag a datset onto a form it creates an
sqlConnection and an sqlDataAdapter but I can't use them because the C#
standard only supports ado. This is a real problem for a beginner like me
because all of the examples in the books always use sql instead of oldDb. I
was able to convert it but that is just one more headache when I am trying
to learn something. It would be great is the C# standard was smart enough to
use only the types it supports. Or did I miss something somewhere?
"Greg Ewing [MVP]" <gewing@_NO_SPAM_gewing.com> wrote in message
news:OS**************@TK2MSFTNGP11.phx.gbl...
Bill, what is oleDbCmdAddDemoReq set up to do? Is it trying to return a
value? Does it have parameters? What is probably happening is that the
query has parameters and it is not able to convert to the requested format
from whatever value you are setting it to. If you want to post the code
that sets up the query we can probably help more.

--
Greg Ewing [MVP]
http://www.citidc.com

Nov 15 '05 #3

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

Similar topics

5
by: Leon Shaw | last post by:
I'm trying to insert a record into a sql server 2000 database using a store procedure (vs.net is my develop tool) on the button click event but I keep getting the following error after clicking the...
1
by: Tim::.. | last post by:
Hi can someone please help me with the following error! I keep getting: ERROR: System.InvalidCastException: Object must implement IConvertible. Line 231: PageID =...
1
by: Tim::.. | last post by:
Can someone please tell me why I keep getting the following error! I can't seem to find out what is causeing the problem and would really appritiate any assistance! Thanks! ... ERROR ...
4
by: charleswesley | last post by:
I think the problem is with the strPrice variable in the AddToCart() sub. I've been messing with it all morning and can't seem to figure it out. Any ideas? ...
1
by: dan | last post by:
I am using VB.NET 2003 and SQL Server 2000. My program inserts new rows in a SQL table based on data read from a file. I generated the commands and the stored procedures with the DataAdapter...
3
by: dan | last post by:
I am using VB.NET 2003 and SQL Server 2000. My program inserts new rows in a SQL table based on data read from a file. I generated the commands and the stored procedures with the DataAdapter...
2
by: Gav | last post by:
Hi All, I'm trying to create a table in a sql database. When I run ExecuteNonQuery(); I get an error "Objects must implement IConvertible". I put the same statement in a textbox, after...
2
by: lcorrias | last post by:
i try to do a simple insert using SQLDataSource and a Stored Procedure I try all night and always have this error Object Must Implement IConvertible
0
by: dan | last post by:
Hi, I've been using a GridView for some time but this is the first time I need to delete a row in the grid whose primary key consists of 2 fields (table columns). I have a table with primary...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.