Format of the initialization string does not conform to specification starting at index 0 on azure

本小妞迷上赌 提交于 2019-12-07 05:12:38

问题


Have been with thi problem for hours, this is my connectionstring:

<connectionStrings>
   <add name="OL4RENTDb" 
     connectionString="Server=v812xrqz2w.database.windows.net;Database=ol4rentDB;User ID=AdminOL4RENT@v812xrqz2w;Password=Grupo501TSI;Trusted_Connection=False;Encrypt=True;MultipleActiveResultSets=True;" providerName="System.Data.SqlClient" />
 </connectionStrings>

an error:

[ArgumentException: Format of the initialization string does not conform to specification starting at index 0.]
   System.Data.Common.DbConnectionOptions.GetKeyValuePair(String connectionString, Int32 currentPosition, StringBuilder buffer, Boolean useOdbcRules, String& keyname, String& keyvalue) +5314705
   System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey) +124
   System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules) +95
   System.Data.SqlClient.SqlConnectionString..ctor(String connectionString) +59

Do you see any problem there?

I am deploying to azure..


回答1:


I had the same error and I fix it by going via FTP to my Azure Website and edited the Web.Config. I noticed that a new connection string entry has been added. I removed it to keep those that I had on my PC and everything worked well. So, if you have this error when you deploy to Azure, check your connections strings.




回答2:


The problem wasnt that web.config's connection string, but the one you specify in publish settings, the one that azure will use to connect to db. Lets say you can have in the local pc the connection string to you local database, and when you publish you put the azure database connection string, and that override your local connection string at web.config.



来源:https://stackoverflow.com/questions/17119650/format-of-the-initialization-string-does-not-conform-to-specification-starting-a

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!