有我的SQL连接代码的麻烦 -无法使SQL连接
SqlConnection con = new SqlConnection("Data Source=D:\\MyDocuments\\Desktop\\WorkHours\\WorkHours\\App_Data\\Database1.sdf;" + "Trusted_Connection=true;");
con.Open();
我只是在通过这些2号线去,只是想获得持续的连接,并即时得到这个错误:
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)
我100%确定我的数据库URL是正确的。帮助将不胜感激
你在什么语言编码? –