1. Home
  2. Computing & Technology
  3. C / C++ / C#

How to Use MySQL Database with Visual C# 2008 Express Edition

By , About.com Guide

1 of 4

A Quick Intro to ODBC

Configuring ODBC For MySQL
This is a guide to using MySQL with Visual C# 2008 Express Edition. If you're not familiar with databases and SQL, read this first. The databases that you can access with Visual C# 2008 Express Edition are pretty limited if you restrict yourself to using the provided Data Sources. Its about the worst aspect with the Visual 2008 Express Editions (C++/C#) as Microsoft not surprisingly wants you to buy the full Visual Studio. However ADO.NET, the technology behind databases on .NET is pretty flexible and it's possible to access a MySQL Database with it using code. For this however you need to access MySQL via ODBC.

What is ODBC?

ODBC (Open Database Connectivity) is a universal way of accessing data in databases. Originally databases had their own software drivers and moving data between them was quite fiddly. You had to export data into a common format such as .csv then import it into the target database. The designers of ODBC aimed to remove that need by making it independent of programming languages, database systems, and operating systems. This was back in 1992 when it was launched by Microsoft and became an open standard three or our years later.

Each database creator created their own ODBC drivers and MySQL has created a couple for .NET. These are 3.51 and 5.1. You'll find them on the MySQL ODBC connector downloads page. Note, there is a non ODBC connector/net which works with Visual Studio 2008 but I am unsure if that works with the Express Edition. ODBC certainly does. I had problems with the 5.1 ODBC driver and found I'm not alone so download the 3.51 driver and install it.

The screenshot shows the ODBC configuration, details on the next page.

On the Next Page - Working with ODBC

Explore C / C++ / C#
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. C / C++ / C#
  4. C# / C Sharp
  5. How To Do Things in C#
  6. Using MySQL Database with Visual C# 2008 Express Edition>

©2009 About.com, a part of The New York Times Company.

All rights reserved.