Visual Basic .NET and MySQL Connection
I've been wondering for quite a long time whether it's possible to connect from Microsoft Visual Basic .NET (VB.NET) to the most popular open source database, MySQL and I do a little research online to try it out. Incredibly, it can done in just a few minutes. Here's my experience...
What I'm using:
What I did:
It's just as simple as that!
Recommended Materials:
Accessing a MySQL Database with a VB.NET Component in an ASP.NET File
Microsoft Visual Studio .NET 2003 Professional Special Edition
What I'm using:
- Microsoft Windows XP Pro (Operating System)
- Microsoft Visual Studio 2003
- MySQL version 3.23.38
What I did:
- Download and install ODBC.NET Provider from Microsoft.
- Download and install MyODBC Driver from MySQL.
- Setup MyODBC DSN in ODBC.
Control Panel > Administrative Tools > Data Source (ODBC) - Copy and modify sample source code from MySQL to test my program and ... VB.NET is already able to query from MySQL database!
It's just as simple as that!
Recommended Materials:
Accessing a MySQL Database with a VB.NET Component in an ASP.NET File
Microsoft Visual Studio .NET 2003 Professional Special Edition
How about VB6 with MySQl ?? Can still use the technique you teach here??
For VB6, you can skip the first step.
And, the source code for VB6 will be different from VB.NET.
why dont you use this:
MySQL Connector/Net for ADO.NET
Gives you direct access to the MySQL API in dotNET. I use it and it works great.
yk.
I will try it out. Thanks for sharing. :)
I did use several ways to connect MySQL with MS FoxPro.. It did work.
to Yoon kit,
i've use MySQL Connector/Net for ADO.NET. but why it didn't work? "imports.data.mySqlClient" does not appear, so i can't use mySqlconnection. I've try to add reference,but the message is "this file(MySql.Data.dll) is not a valid assembly or COM component".
Please help me.....
please contact me at irawan.ongkowijoyo@compnet.co.id
1. Download and install ODBC.NET Provider from Microsoft.
hi this is nice but i think in .net framework 2, it is already bundled upon accessing
imports system.data.odbc
is this works with mysql version 5? or 5.01? need help pls
I, of course, a newcomer to this blog, but the author does not agree