Can I use datasource=.\\SQLEXPRESS or do I need to now use: machinename\\SQLEXPRESS

tdjfdjdj picture tdjfdjdj · May 26, 2011 · Viewed 12.5k times · Source

Can I still use datasource=.\SQLEXPRESS or do I need to change it to : machine_name\SQLEXPRESS for a local instance of SQL Server 2008 Express in C#?

My connection string worked fine in SQL Express 2005, but with the same settings no longer works for 2008.

Answer

Oded picture Oded · May 26, 2011

Assuming the instance name is indeed SQLEXPRESS, using .\SQLEXPRESS will work locally.

Use the SQL Server Configuration Manager to find out the correct instance name.