4

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.

John Saunders
  • 160,644
  • 26
  • 247
  • 397
tdjfdjdj
  • 2,391
  • 13
  • 44
  • 71

2 Answers2

5

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.

Oded
  • 489,969
  • 99
  • 883
  • 1,009
  • Could I create an alias in Configuration Manager and use that as my datasource in my connection string? – tdjfdjdj May 26 '11 at 14:02
  • @user719825 - http://stackoverflow.com/questions/907851/change-sql-server-instance-name – Oded May 26 '11 at 14:03
0

What is the final purpose of the app as it more conventional to include pc name.

Enzero
  • 1,141
  • 2
  • 17
  • 36