我試圖部署我的第一個包含數據庫的網站。測試本地版本具有以下連接字符串生產服務器上的web.config連接字符串
<connectionStrings>
<add name="ApplicationServices"
connectionString="data source=.\SQLEXPRESS;IntegratedSecurity=SSPI;
AttachDBFilename=|DataDirectory|\aspnetdb.mdf;
User Instance=true"
providerName="System.Data.SqlClient" />
<add name="ConnectionString"
connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\AHData.mdf;IntegratedSecurity=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
我設置了網絡上的數據庫託管公司的服務器,他們給了我下面的連接字符串
Provider=sqloledb;Data Source=db479427514.db.1and1.com,1433;Initial Catalog=db479427514;User Id=dbo479427514;Password=****;
Provider=sqloledb;Data Source=db479427535.db.1and1.com,1433;Initial Catalog=db479427535;User Id=dbo479427535;Password=****;
當我替換本地測試連接使用
<connectionStrings>
<add name="ApplicationServices"
connectionString="Provider=sqloledb;Data Source=db479427535.db.1and1.com,1433;Initial Catalog=db479427535;User Id=dbo479427535;Password=**I've used real password!**;"
providerName="System.Data.SqlClient" />
<add name="ConnectionString"
connectionString="Provider=sqloledb;Data Source=db479427514.db.1and1.com,1433;Initial Catalog=db479427514;User Id=dbo479427514;Password=**I've used real password!**;"
providerName="System.Data.SqlClient" />
</connectionStrings>
我得到以下錯誤的新服務器的人串
Keyword not supported: 'provider'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: Keyword not supported: 'provider'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
[ArgumentException: Keyword not supported: 'provider'.]
[ArgumentException: An error occurred while attempting to initialize a System.Data.SqlClient.SqlConnection object. The value that was provided for the connection string may be wrong, or it may contain an invalid syntax.
Parameter name: connectionString]
任何人都可以建議這裏有什麼問題嗎?
http://social.msdn.microsoft.com/Forums/vstudio/en-US/77ff9db1-c69d-4a14-b606-d208832b8756/keyword-not-supported-provider –