1

I am trying to connect to a local SQL Server database and It is not working, the connection String is

Dim connString As String = "server=C:\Program Files (x86)\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA;Integrated Security=SSPI;initial catalog=AdventureWorks"
sqlConn.ConnectionString = connString
sqlConn.Open()
1
  • Thanks for the Quick replies!! I am new to .NET so I guess i need to keep reading... I replaced the absolute path with "localhost" and its working now. thanks again for the help! Dim connString As String = "server=localhost;Integrated Security=SSPI;initial catalog=AdventureWorks" Commented Sep 15, 2011 at 18:51

2 Answers 2

4

The server parameter looks mighty fishy to me.

If this is a SQL Server instance, you are trying to connect to the data file, not the database. It should be the network name of the computer that SQL Server is installed on.

I suggest taking a look at connectionstrings.com to see how it should look like.

Sign up to request clarification or add additional context in comments.

Comments

2

Server has to be a server name. If it's on the same box do localhost in lieu of that long funky path.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.