We need 4 things to do this:

1) Download Mysql database at:
2) Download the GUI for Mysql at: http://dev.mysql.com/downloads/gui-tools/5.0.html
3) Download the connector for .NET 2.0 at: http://dev.mysql.com/downloads/connector/net/5.0.html
4)Download the Mysql ODBC driver at: http://dev.mysql.com/downloads/connector/odbc/3.51.html

All these links will be seen by you if you observe carefully at http://dev.mysql.com/downloads/

First read the article at:

http://www.15seconds.com/issue/050210.htm

Here the installation is given with screen shots

http://www.15seconds.com/issue/050210.htm

Locate the MySql.Data.dll at:
C:\Program Files\MySQL\MySQL Connector Net 5.0.8.1\Binaries\.NET 2.0\
in your system.

While creating a website in ASP.net Create a ASP.NET folder BIN which will be available in 2.0.
After creating the BIN folder place the MySql.Data.dll in BIN Folder.

After installing all the 4.

Just write a small program in asp.net

In code behind file
==============

using System;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data;
using MySql.Data.MySqlClient;

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

MySqlConnection conn = new MySqlConnection

(“server=localhost; user id=root; password=mysqladmin; database=test; pooling=false;”);
string query = “Select * from stud”;
MySqlDataAdapter da = new MySqlDataAdapter(query, conn);

DataSet ds = new DataSet();
da.Fill(ds);

GridView1.DataSource = ds;
GridView1.DataBind();

}
}

Advertisements