我有这个问题,当我启动我的网站,并尝试访问我的数据库:asp.net问题,当我访问我的数据库
Oops. The error: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
我有一个数据库,我连接到它(第一部分我使用的代码是):
System.Data.SqlClient.SqlConnection con;
con = new System.Data.SqlClient.SqlConnection();
con.ConnectionString = "Data Source=.\\SQLEXPRESS; AttachDbFilename=C:\\inetpub\\poject\\App_Data\\data.mdf; Integrated Security = true; Connect Timeout = 30; User Instance = True";
任何帮助将不胜感激?
我没有使用AttachDbFilename连接到数据库,所以我我真的只是猜测在这里。 – 2011-03-25 02:29:14
@Mickey不,你说得对。他不应该得到这个信息,如果这是他的代码,这将有助于“项目”拼写正确。 – Pete 2011-03-25 02:30:30
我知道“项目”拼写错误,但这是我拼写在我的道路上。是他们的任何其他方式连接到数据库,因为这种方式nt工作? – hhh 2011-03-25 02:45:40