Sunday, May 3, 2009

DotNet With MySQL

You can connect to MySQL like any other database .
The primary requirement is you need a data connection provider

A data provider in the .NET Framework serves as a bridge between an application and a data source. A data provider is used to retrieve data from a data source and to reconcile changes to that data back to the data source.


MySql.Data.MySqlClient Namespace contains the class for connecting to MySQL

Assembly: MySql.Data (in MySql.Data.dll)

This dll file is contained in the mysql connector zip file That we can down load from the net

MySQL Connector Net 5.0.3 or any Other .NET connectors

http://dev.mysql.com/downloads/connector/net/5.0.html
http://www.devart.com/dotconnect/mysql/download.html

Install the connector it will register MySql.Data.dll in your global assembly cache.
or you can mannually do it by using the command gacutil /i MySql.Data.dll From your dotnet command prompt

mysql.data.mysql namespace contains the classes you required to connect to mysql database.

Now you can start coding see the link for more details

========================================================
Requirements:

MySQL Server
Mysql Server 5.0 or any other versions.
.Net Connector
MySQL Connector Net 5.0.3 or any Other .NET connectors

http://dev.mysql.com/downloads/connector/net/5.0.html
http://www.devart.com/dotconnect/mysql/download.html

UI For MySQL Server

SQLyog Or any Other User Interface for MYSQL for a better user experience.
if you are very comfortable with command prompt and mysql you can use that one.

For .NET

Visusl Studio 2005 or later.
=======================================================