[Mono-aspnet-list] Unable to connect to MySQL database with SqlConnection!

don rhummy donrhummy at yahoo.com
Tue Jan 8 02:13:11 UTC 2013

I get the error "Connection Refused"! I have the connection string correct from what I can tell. Both the DB and ASP.Net are on the same server.

    SqlConnection oConn = new SqlConnection( "Server=localhost;Database=testDB;Uid=root;Pwd=mypass" );

I get this error:

System.Net.Sockets.SocketException: Connection refused at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remote_end) [0x00000]  at System.Net.Sockets.Socket+Worker.Connect () [0x00000] 

Those exact connection settings work if I do it through ODBC and use a DSN. Why can't I get SqlConnection to work?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-aspnet-list/attachments/20130107/c294790d/attachment.html>

More information about the Mono-aspnet-list mailing list