01.
MySqlConnection objConn;
02.
MySqlCommand objCmd;
03.
04.
void
Page_Load(
object
sender,EventArgs e)
05.
{
06.
String strConnString;
07.
strConnString =
"Server=localhost;User Id=root; Password=root; Database=mydatabase; Pooling=false"
;
08.
objConn =
new
MySqlConnection(strConnString);
09.
objConn.Open();
10.
11.
if
(objConn.State == ConnectionState.Open)
12.
{
13.
this
.lblText.Text =
"MySql Connected"
;
14.
}
15.
else
16.
{
17.
this
.lblText.Text =
"MySql Connect Failed"
;
18.
}
19.
}