Unable to connect to SQL database - C#, VS2012, SQL Server 2012

后端 未结 1 1495
渐次进展
渐次进展 2021-01-29 03:37

I have SQL Server 2005, 2008 and 2012 installed on my Windows 7 64bit PC.

\"enter

1条回答
  •  面向向阳花
    2021-01-29 03:51

    Data Source=adamssqlserver
    

    is wrong, should be:

    Data Source=lpc193\adamssqlserver
    

    This can be seen in the Server Explorer screenshot you attached. Your connection string is looking for a computer calls "adamssqlserver", whereas your database is a named instance on your computer, which is called "lpc193", so is addressed as lpc193\adamssqlserver

    0 讨论(0)
提交回复
热议问题