Link to home
Start Free TrialLog in
Avatar of chris_smith_51
chris_smith_51

asked on

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

I am getting this error:

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

I think it has something to do with my connection string in web.config:

  <connectionStrings>
    <add name="CSGShowAccessDatabase" connectionString="~/App_Data/db.mdb;" providerName="System.Data.OleDb" />
  </connectionStrings>

I am referencing it in my code like so:

<asp:SqlDataSource ID="InsertPersonalInfo" runat="server" ConnectionString="<%$ connectionStrings:CSGShowAccessDatabase %>"
    InsertCommand="INSERT INTO aspnet_UserDetail VALUES ('99', 'Mr.', 'Chris', 'Smith', 'Male', '24/10/1987', false, false, 'd', 'd', 'd', 'd', 'ddd', '01', '07')"
    ProviderName="<%$ connectionStrings:CSGShowAccessDatabase.ProviderName %>">
</asp:SqlDataSource>

The ASP.NET Role manager can access my DB but it seems my code can't. Any ideas?!

Avatar of Daniel Reynolds
Daniel Reynolds
Flag of United States of America image

My first guess is that you are trying to use the "~" to say get the root. This is not allowed in the web.config.
State the full path to the database to get better results.
Avatar of chris_smith_51
chris_smith_51

ASKER

thanks for the reply, i changed it to simply "App_Data/db.db" but i still get the same error
ASKER CERTIFIED SOLUTION
Avatar of chris_smith_51
chris_smith_51

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial