Reputation: 1
I've looked through the Web for the better part of 2 days trying to find how to connect to SQL Server 2012 that came with VS Express 2013 for Desktop.
Based on some things I found on various sites, in my connection string (starting with "") I've tried
Server=.\MSSQLEXPRESS;Database=BrightStar;user=root;password=root
then
.(local)\MSSQLEXPRESS
and
.(localhost)\MSSQLEXPRESS)
as well as all combinations without the "MS" (just SQLEXPRESS
).
Nothing works so far.
The error message is
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
So the question is, what is the instance name of the SQL Server that comes packaged with this version of Visual Studio? Also, I haven't gotten to the "user" and "password" parameters, but help would be welcome there, too. (I was guessing at "root".)
If there's any other information I can provide that would be helpful, please ask.
Thanks.
(BTW, is this SQL Anywhere?)
Upvotes: 0
Views: 1718
Reputation: 755207
If you have a normal installation without changes, then you have SQL Server Express with an instance name of SQLEXPRESS
.
So you can connect to that either using
.\SQLEXPRESS
or
(local)\SQLEXPRESS
or
your-machine-name\SQLEXPRESS
(or even with your IP, if you want to)
The .
or (local)
(or localhost
, if you insist) stand for the local machine and the \SQLEXPRESS
is the default instance name for a SQL Server Express installation.
With SQL Server 2012 and newer, you also get the LocalDB feature - learn more about LocalDB here
To connect to that instance, you'd use
(LocalDB)\v11.0
as the server/instance name (or (LocalDB)\v12.0
for SQL Server 2014 LocalDB)
For a great intro to SQL Server 2012 LocalDB, see Aaron Bertrand's article Getting Started with SQL Server 2012 Express LocalDB
Upvotes: 3