Reputation: 718
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()
Upvotes: 1
Views: 360
Reputation: 499002
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.
Upvotes: 4
Reputation: 12243
Server has to be a server name. If it's on the same box do localhost in lieu of that long funky path.
Upvotes: 2