How to connect to SQL Server Express from Visual Studio 2008

jrattinger used Ask the Experts™

I have the following setup, Windows Server 2008, Visual Studio 2008, Sql Server 2008, Sql Server Express 2008. I have created a test database in Sql Sserver Express, but I cannot see it in visual studio. From Visual studio, I have tried to add a new connection with the server explorer, but sqlserver express, or my database never show up in the data source or database drop-down lists.

Is that something that i need to do in sql server express to endable VS to see the connection? I have "registered" the database, but that didn't seem to do anything.

Any pointers would be appreciated.

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Is the database server running?  You can check by going to Admin tools -> Services and if its running then checking if a serviced with a name similar to Sql Server 2008 Express should be running.  Sql Browser should also be running.  If not already installed, I would install Visual Studio 2008 Service Pack 1, its known to fix a few issues related to sql server 2008.  Also, can you connect to Sql server through Management Studio, if not then you are not likley to be able to connect from anywhere else.


thank for the response.

Yes the database is running. I actually created a new database and table via management studio.

When I try to create a new data connection from VS, sql server express doesn't show up in the data source list. I only see "Microsoft Sql Server", "Microsoft SQL Server Compact 3.5" and "Microsoft SQL Server Database File".

Maybe I'll try the VS service pack tomorrow. I don't know what else to do. It seems like sql server express doesn't even exist to VS.
Hello jrattinger,

Well, about the SQL Server Express does not show up in the data source list, that is normal. Both SQL Server and SQL Server Express appears as Microsoft SQL Server. Try to do the following:

Click on the "Add Connection..."
On the 'Data Source' list, select Microsoft SQL Server
Click continue

Ok, now on the Server Name combo box, check out wich instances appear on the list. You sayed that you have SQL Server 2008 and SQL Server 2008 Express, wich means that 2 instances have to appear on the list. If only one instance appears on the list, wich must be [Computer Name]\MSSQLSERVER, you can try to specify the instance name of the SQL Server 2008 Express manually. The default instance name of SQL Server Express is SQLEXPRESS, so try to type in ComputerName\SQLEXPRESS, where ComputerName you replace by the name of your computer or server. Now select the authentication type and see if your database appears on the "Select or enter database name". If that does not work, go to the SQL Server Configuration Manager and check the instance name of the SQL Server 2008 Express. Also check if the SQL Server 2008 Express service is started. If not, right-click it and select "Start", go back to the "Add Connection..." and try to type the instance name manually again. Finally, if all that does not work, it is highly recommended to install the SP1 of Visual Studio 2008.


That Worked!  Thank you sooooo much.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial