473,587 Members | 2,479 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Objects must implement IConvertible

Gav
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 getting the error I copied the
statement into SQL's query analyser and the command works fine.

Anyone know where I might be going wrong?

Thanks
Gav

Feb 14 '06 #1
2 1356
Hello, Gav!

Can you specify more details about that query, and if it is possible post the code, where you're
building sql query.

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Feb 14 '06 #2
Gav
I'm sorry it really was a silly mistake of my part I just didn't spot it.

I was creating parameters in the command too early. (there are parameters
for the insert which comes next, and I was setting the parameters before I
called the CREATE TABLE command!! - really must take more care in my coding
before scratching my head)

Thanks anyway
Gav

"Vadym Stetsyak" <va*****@ukr.ne t> wrote in message
news:%2******** **********@tk2m sftngp13.phx.gb l...
Hello, Gav!

Can you specify more details about that query, and if it is possible post
the code, where you're
building sql query.

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com

Feb 15 '06 #3

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

Similar topics

2
11355
by: Bill Cart | last post by:
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:
5
3930
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 button: Object must implement IConvertible. What Can I do to fix this problem. It seems like it want to explicit convert a value to a specific datatype, but I set my command through vs.net which took care of that for me. what would you suggest?
7
1747
by: Brian Henry | last post by:
Hi, I am doing the following stored procedure CREATE PROCEDURE . @sender varchar(50), @subject varchar(400), @messagebody text, @hasAttachments bit, @sentTime DateTime AS
1
1800
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 = cmd.Parameters("@PageID").Value Line 232: Line 233: Dim myReader As SqlDataReader = cmd.ExecuteReader()
4
2135
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? +++++++++++++++++++++++++++++++++++++++++++ + EXCEPTION + +++++++++++++++++++++++++++++++++++++++++++ Object must implement IConvertible. Description: An unhandled exception occurred during the execution of
1
2434
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 wizard. The execution of the Insert Command throws the exception: "Object must implement IConvertible. " 1. What object does it refer to? The Command itself? 2. On the other hand, in the VS Help file all IConvertible members have this warning:...
3
2629
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 wizard. The execution of the Insert Command throws the exception: "Object must implement IConvertible. " 1. What object does it refer to? The Command itself? 2. On the other hand, in the VS Help file all IConvertible members have this warning:...
2
2356
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
1975
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 key set to c1,c2 where c1 is a uniqueidentifier and c2 is int. The DataKeyNames in the gridview is defined as follows: DataKeyNames="c1,c2".
0
7923
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7852
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8349
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
5395
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3845
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3882
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2364
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1455
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1192
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.