Connection String

I'm trying to create a new connection to an SQL Express Database from inside Visual Basic .Net
If i try to choose an sql Database created with SQL Server Management Studio or try to create a new database, the error message is the same:

"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 setting SQL Server does not allow remote connections.
(provider: SQL Network interfaces, error: 26 - Error locating Server/Instace Specified"

This message seems very explicit but, even though i'm not able to solve the problem

Can you Help?

My thanks in advanced

Comments

  • If your DB instance is on the local machine it sounds like your server string is wrong. It should be or if there is no instance. I belive the defualt for SQL Express is an instance named SQLExpress unless you change it on install.

    [code]SERVER=(local) ;DATABASE=MyDB;Integrated Security=SSPI;
    SERVER=(local)SQLExpress ;DATABASE=MyDB;Integrated Security=SSPI;[/code]

    If it is not on the local machine... You probably have to enable the TCP/IP protocol for the instance open the SQL configuration tool. Open it from the programs menu and select the instance in the network configuration item and enable the TCP/IP.

    ~rlc
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion