我正在尝试使用以下代码在我的应用程序中连接到 Sql Server:
SqlConnection myConnection = new SqlConnection();
myConnection.ConnectionString = "Data Source = (local);Initial Catalag = Inventory;
Persist Security Info = false;
Integrated Security = true;
Packet Size = 4096;Connect TimeOut = 30";
myConnection.Open();
其中 Inventory 是我的数据库,它存在于我的本地计算机上。
“错误 40:无法打开与 Sql Server 的连接”---错误在上述代码执行时出现。