用asp.net如何连接mysql?

用asp.net如何连接mysql?

用asp.net如何连接mysql?      
连接成功,但首先要下载,mysql的odbc驱动程序
<%@ Page Language="C#" Debug="true" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.Odbc" %>

<%
String con ="Driver={MySQL ODBC 3.51 Driver};Server=localhostort=3306;Option=4;Stmt=;Database=test;user=root;password=; " ;
OdbcConnection myConnection = new OdbcConnection(con);

OdbcDataReader reader ;
OdbcCommand cmd = new OdbcCommand ("SELECT * FROM mmz", myConnection) ;
cmd.Connection.Open();
reader = cmd.ExecuteReader ( ) ;while ( reader.Read ( ) )
{
Response.Write(reader["username"].ToString ( ));
Response.Write("<Br/>");
Response.Write(reader["userid"].ToString ( ));
Response.Write("<Br/>");
}
reader.Close ( ) ;
myConnection.Close();



%>