Basically all i want to do it connect remotely to a SQL server on my
personal webpage that is hosted by bluehost.com
I have added a sql db on the site with a user name and password. I have also
added my IP to the white list and access host list for sql in cpanel.
Then I wrote a very small app just to test to see if i could simply connect
to it.
Basically i have a form with a button and a click event for the button. the click event calls a sql() function.
I wrote the application in c#... here is my connect function inside my sql() function:
Its not allowing me to connect at all. I get this error from my exception:
"An error has occurred while establishing a connection to the server. When
connecting to SQL Server 2005, this failure may be caused by the fact that
under the default settings SQL Server does not allow remote connections.
(provider: Named Pipes Provider, error: 40 - Could not open a connection to
SQL Server)"
I am using VS 2005 Professional.
I opened port UDP 1434 on my linksys router.
I disabled the windows firewall and norton.
I added the ability to have Remote connections via TCP/IP in Microsoft SQL Server 2005 Configuration Manager.
I also called bluehost and tech support said i have configured everything
properly on that side and he was able to connect to it.
Is there anything that you might be able to suggest to help me get this
connection.
I would very much appreciate your time and consideration with this problem.
Thanks so much,
personal webpage that is hosted by bluehost.com
I have added a sql db on the site with a user name and password. I have also
added my IP to the white list and access host list for sql in cpanel.
Then I wrote a very small app just to test to see if i could simply connect
to it.
Basically i have a form with a button and a click event for the button. the click event calls a sql() function.
I wrote the application in c#... here is my connect function inside my sql() function:
Code:
private void sql()
{
SqlConnection myConnection = new SqlConnection("user id=my_user_id;" + "password=my_pwd;server=my_url" +
"Trusted_Connection=yes;" +
"database=my_db; " +
"connection timeout=30");
try
{
myConnection.Open();
}
catch (Exception e)
{
MessageBox.Show(e.Message);
Console.WriteLine(e.Message);
}
}
Its not allowing me to connect at all. I get this error from my exception:
"An error has occurred while establishing a connection to the server. When
connecting to SQL Server 2005, this failure may be caused by the fact that
under the default settings SQL Server does not allow remote connections.
(provider: Named Pipes Provider, error: 40 - Could not open a connection to
SQL Server)"
I am using VS 2005 Professional.
I opened port UDP 1434 on my linksys router.
I disabled the windows firewall and norton.
I added the ability to have Remote connections via TCP/IP in Microsoft SQL Server 2005 Configuration Manager.
I also called bluehost and tech support said i have configured everything
properly on that side and he was able to connect to it.
Is there anything that you might be able to suggest to help me get this
connection.
I would very much appreciate your time and consideration with this problem.
Thanks so much,