what version of .NET framework you are using?
did you put the port number in like this??
string strMySQLConnection = "server=localhost:3306;user id=UserName;Password=UserPassword;
or try this connection string
string strMySQLConnection = "server=localhost:3306;Database=database;Uid=root;Connect Timeout=30;"
and this is the basic Connection string
string strMySQLConnection = "server=localhost;User Id=root;database=database"