| |
 |
|
|
|
|
|
|
Introduction |
Using
MySQL OLE DB Provider in Visual Studio 2005 IDE is really easy.
But some of you may or may know how to set it up. We are going to show you
how to set it up and what problems you may run into.
|
| Setup MySQL Provider with VS 2005 |
We will guide you through step by step to complete the setup process
- Find Server Explorer in VS 2005, right click Data Connections and select Add Connection...
on context menu. Then you shall see pop up dialog below.
- Click Change... button to change Data Source.

- Select <other> in the Data source list, select .NET Framework Data Provider
for OLE DB in the Data Provider drop down list and then click OK button.

- Select MySQL Provider in OLE DB Provider, Click Data Links... button so that you
can fill MySQL database file name (must be full qualified path) into the Data Source
field. Click OK on the dialog above. Now your data connection shall be added into
Server Explorer panel.
|
|
Running MySQL Queries |
You setup MySQL OLE DB provider with VS 2005 IDE.
Now you can run MySQL queries by right clicking the data
connection you just added and the select New Query on
the context menu.

Select a table and click add and close buttons. You shall be able run queries now.
|
|
Problems |
Visual Studio 2005 verifies the query syntax before it calls OLE DB Provider. However,
MySQL query syntax is not complete the same as that for SQL Server.
Fortunately, Microsoft® does not prevent us from running this query. We can simply click continue to let the query run.
One other thing we have to point out is that it is always a good idea to set a limit
for number of records you want to retrieve from MySQL database because it may take
very long if you have millions of records.
|
|
|
|
Copyright © Cherry City Software LLC, 2006 - 2009. All Rights Reserved. |