我想學習連接到SQL Server數據庫並使用C#(ASP.NET網站外)執行功能。當我嘗試運行時如何連接到VS Express中的SQL Server數據庫的網絡
SqlConnection con = new SqlConnection("Data Source=.; database=fengshuidb; integrated security = SSPI");
SqlCommand cmd = new SqlCommand("Select * from emails", con);
con.Open();
連接我得到以下錯誤與con.Open()
指令。
從VS:
"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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"
什麼我需要做的配置連接到數據庫?我需要什麼安全設置?這個話題有沒有好的資源?