我剛剛安裝了Visual Studio 2017社區。我正在開始一個新的ASP.net WebForms C#項目,但我的連接字符串有問題。這是我迄今所做: 創造了個人用戶的WebForms應用程序帳戶 改變了web.config文件中DefaultConnection到Visual Studio 2017連接字符串無法連接到服務器
<connectionStrings>
<add name="DefaultConnection" connectionString="Data Source=s13.example.com;Initial Catalog=DB_9;User ID=DB_9_user;Password=myPwd;Integrated Security=False;"
providerName="System.Data.SqlClient" />
然後我添加一個SqlDataSource和嘗試使用DefaultConnection ,但出現以下錯誤:
Database schema could not be retrieved for this connection. Please make sure the connection settings are correct and that the database is online.
Failed to retrieve data for this request.
Failed to connect to server (local).
Login failed for user 'DB_9_user'.
接下來,驗證服務器,用戶名和密碼是否正確。我在Sql Server Management Studio 2012中使用相同的憑據成功連接到數據庫。所以接下來,我用Visual Studio 2013 Professional關閉了我的舊電腦,並在那裏重新創建了這個項目。在改變連接字符串並在SqlDataSource控件中使用它時完全沒有問題。 VS 2017 Community Edition有什麼不同,阻止了我連接數據庫的能力?