473,323 Members | 1,547 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,323 software developers and data experts.

call prepared statement in C# (for mysql), why IDbConnection does not have method to CreateDataAdapter()?

Hi,

I downloaded the latest version of mysql 5.0 and its .NET driver, I copied
the sample code from mysql 5.0 manual to do use prepared statement in C#.
But indeed I got a run time error say that "#42000You have an error in your
SQL syntax; ..."

I tried variuos format and I get regular statement(with parameters) and
stored procedure works fine in my c# code, but just not for cmd.Prepare().

Can someone tell me what actually is right syntax to use ? Thanks a lot!

===================

And I see sample code from MySql, or Microsoft SDK, I am surprise to see the
writer like to new a specific type IDbCommand, not use
IDbConnection.CreatCommand(), isn't the second way more generic and
prefered? Is there difference between two way?

And why the IDbConnection does not have method to CreateDataAdapter()?

I want my application support different database, I have to repeat code for
different driver is realy not a happy thing.

Thanks a lot!
Mar 22 '06 #1
0 5096

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

Similar topics

13
by: John | last post by:
First I'll answer "why". Because, while SQL Server is available, it is also "expensive". MySQL is CHEAP and a lot more robust than Access. Is there a way to add, update, retrieve, and delete...
1
by: Tom D | last post by:
I'm rewriting a database interface that our company currently has. Currently it's using the Pear::DB interface, but we found that that was introducing a bit too much overhead. I'm rewriting the...
0
by: phil | last post by:
I am having a problem with the C api with prepared statements, the data recorded in the database does not match the data I am sending. It seems to be some sort of bit shifted version of the data,...
8
by: flu | last post by:
I recently had to modify an application that had originally been written for SQL Server to work with MySQL. I found myself replacing all of the declarations for the connection and command objects...
2
by: Cyril VELTER | last post by:
I'm converting an application to use the V3 protocol features in the 7.4 libpq. As I need to make a design choice regarding the use of prepared statements, I'm wondering what ressources does a...
3
by: Peter Kirk | last post by:
Hi do I need to explicitly close IDbConnection and IDbCommand objects? Or are they disposed of when the method they are used in ends? Normally I use a construct like: using (IDbConnection...
5
by: loudwinston | last post by:
Hello, I'm encountering a strange error with PDO. The server is FreeBSD 4.4, PHP 5.1.2, mySQL 4.0.20 with 4.1.18 client libs. I have the following code (usernames and passwords changed to...
5
by: jmark | last post by:
I need some assistance on how to create a select statement using PEAR DB or MySQL with the LIKE function. That is I am looking of how I can get statement like this work. SELECT * FROM customer...
2
by: newbie | last post by:
Dear folks, pardon me if this is a stupid question. For this table --------------------------------------- | id | foo | bar | -------------------------------------- I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.