Sunday, February 19, 2012

Connection String for remote Sql server

Hi,

I trying to connect to the sql server in the network. The sqlserver is in the machine called "pinnacle". I am Using the following connection string to connect and i am getting the error "Sql server does not exist or Access denied"

Public databaseConnectionStringSQLAsString = "Data Source=(pinnacle);Initial Catalog=cms;Trusted_connection=True;User Id=dbuser;Password=password"

Any help will be appriciated.

Reagrds,

Thiyasoft

Try to change Trusted_connection to false and you don't need the parentheses around the server name..|||I tried , still i got the same error.|||

If you are trying to connect to a remote sql server 2005 then you may have to set up the server to allow remote connections.

http://www.datamasker.com/SSE2005_NetworkCfg.htm

|||

First make sure your connection string is correct. You can checkwww.connectionstrings.com. Use correct value for Data Source property. SQL Server Instance name is the machine name if it is a default instance, and in case of named instance the SQL instance name should be machinename/SQLInstancename (e.g. myserver/SQLEXPRESS).

And you also need to check remote connections on the remote SQL instance, please check this KB.

If connect via the SQL instance name still fails with error "SQL Server does not exist...", you can try to force the connection using TCP/IP network library as mentioned inthis post.

No comments:

Post a Comment