Reputation: 93
I added a "create User Wizard" to a web Form and change the web.config file to change the database address. I ran this form and filled the fields , then clicked the submit button. This error page was appeared :"Server Error in '/' Application. Format of the initialization string does not conform to specification starting at index 0. " . After that I checked the connection String that i had entered , that was okey. I checked it on an other application. Here is web.config file :
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<connectionStrings>
<add
name="MyConnectionString"
connectionString="Data Source=DESKTOP-RMNK148;Initial Catalog=MySiteDatabase;User ID=MyUserID;Password=MyPassword"
providerName="System.Data.SqlClient"/>
</connectionStrings>
<appSettings>
<add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />
</appSettings>
<system.web>
<membership defaultProvider="MyProvider">
<providers >
<clear/>
<add
name="MyProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionString="MyConnectionString"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
requiresUniqueEmail="false"
passwordFormat="Hashed"
applicationName="/"
/>
</providers>
</membership>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.5.2"/>
<httpRuntime targetFramework="4.5.2"/>
</system.web>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs"
type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701"/>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+"/>
</compilers>
</system.codedom>
</configuration>
Upvotes: 1
Views: 140
Reputation: 24957
Seems that your UserID
parameter is not valid in provided connection string. Try User ID
(with whitespace) instead:
<add name="MyConnectionString"
connectionString="Data Source=DESKTOP-RMNK148;Initial Catalog=MySiteDatabase;User ID=MyUserID;Password=MyPassword"
providerName="System.Data.SqlClient"/>
Note that "format of the initialization string does not conform to specification starting at index 0" error always occurs if the connection string is not in correct format, or contains invalid characters (like database password which uses semicolons).
Reference: SQL Server Connection Strings
Related issue: Format of the initialization string does not conform to specification starting at index 0
Upvotes: 2