ASP.NET connection to local DB not working
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.Connectio开发者_如何学编程nString = connString
sqlConn.Open()
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.
Server has to be a server name. If it's on the same box do localhost in lieu of that long funky path.
精彩评论