Click here to Skip to main content
15,887,350 members
Home / Discussions / C#
   

C#

 
GeneralRe: Creating Web Service in C# Pin
pmarfleet4-Nov-07 8:19
pmarfleet4-Nov-07 8:19 
QuestionIntegrated two project in one Pin
Assaf824-Nov-07 4:00
Assaf824-Nov-07 4:00 
AnswerRe: Integrated two project in one Pin
Paul Conrad4-Nov-07 4:42
professionalPaul Conrad4-Nov-07 4:42 
GeneralRe: Integrated two project in one Pin
Anthony Mushrow4-Nov-07 4:58
professionalAnthony Mushrow4-Nov-07 4:58 
GeneralRe: Integrated two project in one Pin
Paul Conrad4-Nov-07 5:26
professionalPaul Conrad4-Nov-07 5:26 
GeneralRe: Integrated two project in one Pin
Assaf824-Nov-07 6:13
Assaf824-Nov-07 6:13 
GeneralRe: Integrated two project in one Pin
Paul Conrad4-Nov-07 6:21
professionalPaul Conrad4-Nov-07 6:21 
QuestionConnecting to remote MySQL database: cannot open connection Pin
mwholt4-Nov-07 2:48
mwholt4-Nov-07 2:48 
Hey - I'm trying to open a connection to a database hosted on my Unix server remotely:

private static void OpenSqlConnection()<br />
        {<br />
            MySqlConnection oMySqlConn = new MySqlConnection();<br />
<br />
            oMySqlConn.ConnectionString = "server=mydomain.com;database=uname_main;user id=uname_main;pwd=myPwd;pooling=false;port=3306;";<br />
<br />
<br />
<br />
            try<br />
            {<br />
<br />
                oMySqlConn.Open();<br />
<br />
                if (oMySqlConn.State == ConnectionState.Open) MessageBox.Show("Connection to MySQL opened through OLE DB Provider");<br />
<br />
                oMySqlConn.Close();<br />
<br />
            }<br />
            <br />
            catch (MySqlException ex)<br />
            {<br />
<br />
                MessageBox.Show(ex.Number + " - " + ex.Message, "DB-Connection");<br />
<br />
            } <br />
            <br />
<br />
        }


Everything works fine (as in, I'm using all required libraries, such as MySQL.Data/MySQL.Data.MySQLClient) and I get no errors until I run this method. After about 8 seconds, it constantly says:

1042 - Unable to connect to any of the specified MySQL hosts.

I'm positive that my domain name is correct and that all login credentials are correct. In CPanel on my server I've added %, %.%.%.%, and my IP address as access hosts and I still can't seem to open the connection.

I've been working on this for hours but to no avail, and online help has proved not useful so far.

Any suggestions? I'd gladly appreciate some!

-Matt
GeneralRe: Connecting to remote MySQL database: cannot open connection Pin
mwholt4-Nov-07 2:54
mwholt4-Nov-07 2:54 
AnswerRe: Connecting to remote MySQL database: cannot open connection Pin
Guffa4-Nov-07 3:41
Guffa4-Nov-07 3:41 
GeneralRe: Connecting to remote MySQL database: cannot open connection Pin
mwholt4-Nov-07 8:28
mwholt4-Nov-07 8:28 
GeneralRe: Connecting to remote MySQL database: cannot open connection Pin
mwholt4-Nov-07 8:43
mwholt4-Nov-07 8:43 
AnswerRe: Connecting to remote MySQL database: cannot open connection Pin
Paul Conrad4-Nov-07 4:44
professionalPaul Conrad4-Nov-07 4:44 
QuestionHow to select the Server Pin
Assaf824-Nov-07 1:26
Assaf824-Nov-07 1:26 
AnswerRe: How to select the Server Pin
Koltz4-Nov-07 1:34
Koltz4-Nov-07 1:34 
GeneralRe: How to select the Server Pin
Assaf824-Nov-07 1:47
Assaf824-Nov-07 1:47 
AnswerRe: How to select the Server Pin
I Believe In GOD4-Nov-07 2:05
I Believe In GOD4-Nov-07 2:05 
GeneralRe: How to select the Server Pin
Assaf824-Nov-07 2:08
Assaf824-Nov-07 2:08 
GeneralRe: How to select the Server Pin
I Believe In GOD4-Nov-07 2:14
I Believe In GOD4-Nov-07 2:14 
GeneralRe: How to select the Server Pin
Jimmanuel4-Nov-07 4:52
Jimmanuel4-Nov-07 4:52 
GeneralRe: How to select the Server Pin
Paul Conrad4-Nov-07 6:10
professionalPaul Conrad4-Nov-07 6:10 
GeneralRe: How to select the Server Pin
Koltz4-Nov-07 6:26
Koltz4-Nov-07 6:26 
GeneralRe: How to select the Server Pin
I Believe In GOD5-Nov-07 4:42
I Believe In GOD5-Nov-07 4:42 
GeneralRe: How to select the Server Pin
Jimmanuel5-Nov-07 4:56
Jimmanuel5-Nov-07 4:56 
GeneralRe: How to select the Server Pin
Assaf824-Nov-07 2:25
Assaf824-Nov-07 2:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.