Re: OdbcDataAdapter and MySQL
From: Austin Ehlers (the*bored*guy*16_at_hotmail.com)
Date: 03/16/04
- Next message: David Dimmer: "dataGrid dataview editing error after sorting"
- Previous message: Jochen Kalmbach: "Re: Interfacing to a .lib library"
- In reply to: Mikael Thorsson: "Re: OdbcDataAdapter and MySQL"
- Next in thread: Mikael Thorsson: "Re: OdbcDataAdapter and MySQL"
- Reply: Mikael Thorsson: "Re: OdbcDataAdapter and MySQL"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 16 Mar 2004 00:45:08 -0600
On 13 Mar 2004 03:49:08 -0800, thorsson_mikael@hotmail.com (Mikael
Thorsson) wrote:
>Sorry, same problem I'm afraid :(
>
>I guess this means that there's something fishy about my setup? Here
>is a list of the versions of the references that I have in my project.
>Can you please tell me if you see any problems here?
>
>Microsoft.Data.Odbc, version 1.0.3300.0
>System, System.Data, System.Drawing, System.Windows.Forms, System.XML,
>all version 1.0.5000.0.
>
>I added the odbc reference by browsing to
>
>C:\Program Files\Microsoft.NET\Odbc.Net\Microsoft.Data.Odbc.dll
>
>I'm running XP Professional SP1 and I also installed the latest MDAC.
>
>Any ideas appreciated!
Two things that might be going on:
1) Don't use Microsoft.Data.Odbc reference; use System.Data
reference, and "using System.Data; using System.Data.Odbc;" instead.
You'll need ODBC.NET driver (not included with VS):
http://www.microsoft.com/downloads/details.aspx?FamilyId=6CCD8427-1017-4F33-A062-D165078E32B1&displaylang=en
Configure the driver in Control Panel>Administrative Tools>Data
Sources. Select "System DSN">Add>MySQL ODBC 3.51 Driver DSN. Use the
following code to connect:
OdbcConnection conn=new OdbcConnection("DSN=/*the name you chose
just*/");
2) I remember reading somewhere that the Odbc driver has a problem
with certain types of tables, specifically MyISAM types. Try changing
it to InnoDB.
Austin
- Next message: David Dimmer: "dataGrid dataview editing error after sorting"
- Previous message: Jochen Kalmbach: "Re: Interfacing to a .lib library"
- In reply to: Mikael Thorsson: "Re: OdbcDataAdapter and MySQL"
- Next in thread: Mikael Thorsson: "Re: OdbcDataAdapter and MySQL"
- Reply: Mikael Thorsson: "Re: OdbcDataAdapter and MySQL"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|