How do I find what is the named instance of my SQL Server 2012 Express instance

user1691774 picture user1691774 · Sep 23, 2012 · Viewed 16.2k times · Source

Using SSMS to validate my ServerName\instance ... I can only get it to connect with the dot . (or computerName). I thought the default instance was .\SQLEXPRESS ... but this does not work.

It seems Visual Studio 2012 also expects (.\SQLEXPRESS) .... changing my web.config file to reflect the data source as DATA SOURCE= .; fixes nothing....VS 2012 cannot find my SQL Server 2012 Express when trying to add a database item. All my attempts have failed.

I tried to post image but it fussed at me because I am a new user.... but here is the Visual Studio Error Message I received when I attempt to add a database:

Network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was accessible. Verify that the instance name is correct and that SQL Server is configured to allowed remote connections. (provider: SQL Network Interfaces, error: 50 -Local database runtime error occurred. Cannot create an automatic instance. See the Windows App event log for error details

Windows App Event Log:

Cannot access LocalDB instance folder: %%LOCALAPPDATA%%\Microsoft\Microsoft SQL Server Local DB\Instances\.

(examining the above path.. shows only an instances folder and a projects sub-folder. The project folder contains many files including master db)

How to I sync of my SQL Server 2012 Express installation with VS 2012??

Answer

niktana picture niktana · Sep 23, 2012

for checking your connection do the following steps create a new textbox them rename it to a file with udl index for example a.udl now open this file there are 4 tabs first you should select microsoft ole db provider for sql server in second tab (connection tab)select your server name the exact one that you connect with sql server(for example NIKTANA\SQLEXPRESS) now set the user and pass and if your server name is ok you see the databases on your server choose the database click ok and now if you open the file with notepad you see your connection string this connection string work in visual studio