Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MySQL Connection

3 views
Skip to first unread message

Roger Cantillo

unread,
Dec 22, 2003, 4:12:06 PM12/22/03
to
Hi:
I'm trying to make a connection to a MySQL database, but I keep getting this
error:

System.ArgumentException: Keyword not supported: 'provider'.

This is the code that fails:

objConn = New SqlConnection("Provider=MSDASQL; DRIVER={MySQL ODBC 3.51
Driver}; Server=localhost; UID=root; PWD=; database=helloworld;
Option=16387;PORT=3306;STMT=;")

Any ideas?


Roger


Richard K Bethell

unread,
Dec 22, 2003, 4:12:59 PM12/22/03
to
"Roger Cantillo" <rog...@axiomsw.com> wrote in message
news:%23YQXa9M...@TK2MSFTNGP12.phx.gbl...

Many problems here:

1. You can't use the SqlConnection object to connect to an ODBC database.
That object is a SQL Server specific object and can only be used to go to a
SQL Server database.
2. You can't use the ODBC driver directly as an OleDb provider. There is an
OleDb driver for MySQL - you need that, or the native .NET driver.

http://www.mysql.com/articles/dotnet/

R.


Eric Sabine

unread,
Dec 22, 2003, 4:55:32 PM12/22/03
to
Richard helped you already, but I thought I'd pass on this link.

http://www.connectionstrings.com

hth
Eric


"Roger Cantillo" <rog...@axiomsw.com> wrote in message
news:%23YQXa9M...@TK2MSFTNGP12.phx.gbl...

Armin Zingler

unread,
Dec 22, 2003, 4:14:28 PM12/22/03
to
"Roger Cantillo" <rog...@axiomsw.com> schrieb


Use an OleDBConnection instead.

See also: http://www.connectionstrings.com/

Group for ADO.NET related questions:
microsoft.public.dotnet.framework.adonet

--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Brian Henry

unread,
Dec 22, 2003, 5:26:00 PM12/22/03
to
sqlconnection is for MS-SQL Server only... use OleDB connection


"Roger Cantillo" <rog...@axiomsw.com> wrote in message
news:%23YQXa9M...@TK2MSFTNGP12.phx.gbl...

Herfried K. Wagner [MVP]

unread,
Dec 22, 2003, 5:28:03 PM12/22/03
to
* "Roger Cantillo" <rog...@axiomsw.com> scripsit:

Maybe it's really "not supported", but have a look at
<http://www.connectionstrings.com>. Maybe you want to use an other data
provider:

<http://www.mysql.com/articles/dotnet/#ADO.NET>

dbProvider
<http://www.einfodesigns.com/products.aspx>

MySQLNet
<http://sourceforge.net/projects/mysqlnet>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Cor

unread,
Dec 23, 2003, 3:29:38 AM12/23/03
to
I tried that last link but there was very few about MySQL

> MySQLNet
> <http://sourceforge.net/projects/mysqlnet>
>
--
> Herfried K. Wagner [MVP]
> <http://www.mvps.org/dotnet>

Cor


Herfried K. Wagner [MVP]

unread,
Dec 23, 2003, 7:49:03 AM12/23/03
to
* "Cor" <n...@non.com> scripsit:

> I tried that last link but there was very few about MySQL
>
>> MySQLNet
>> <http://sourceforge.net/projects/mysqlnet>

ACK, there is "only" a MySQL driver for ADO.NET available...

Cor

unread,
Dec 23, 2003, 7:55:25 AM12/23/03
to
Hi Herfried,

That last link was

> Herfried K. Wagner [MVP]
> <http://www.mvps.org/dotnet>

:-)) and I knew it was not there but it was so thight on the others that you
could think it was.

Cor


Herfried K. Wagner [MVP]

unread,
Dec 23, 2003, 8:19:27 AM12/23/03
to
* "Cor" <n...@non.com> scripsit:

Oh, nice joke!

:-)

--

0 new messages