Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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..

like image 735
El pocho la pantera Avatar asked Jun 15 '13 02:06

El pocho la pantera


2 Answers

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.

like image 103
Patrick Desjardins Avatar answered Oct 20 '22 19:10

Patrick Desjardins


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.

like image 4
El pocho la pantera Avatar answered Oct 20 '22 17:10

El pocho la pantera