02 May 2009

Solution to the “Format of the initialization string does not conform to specification starting at index 0.” Exception

You are probably using the wrong DbConnection class.

If you are using Access then make sure you use OleDbConnection, not SqlConnection…and vice versa.

Alternatively you could be referencing your MDB file wrong.  Here’s the proper way:

<connectionStrings>
    <add name="Videos" connectionString="Provider=Microsoft.Jet.OLEDB.4.0; Data Source={0}App_Data\Videos.mdb" providerName="System.Data.OleDb"/>
  </connectionStrings>

public static string ConnectionString = string.Format(ConfigurationManager.ConnectionStrings["Videos"].ConnectionString, HttpContext.Current.Server.MapPath("~/"));

Filed under: , , , ,
 

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Solution to the ???Format of the initialization string does not conform to specification starting at index 0.??? Exception | Microsoft Share Point said:

PingBack from http://microsoft-sharepoint.simplynetdev.com/solution-to-the-%e2%80%9cformat-of-the-initialization-string-does-not-conform-to-specification-starting-at-index-0%e2%80%9d-exception/

02 May 09 at 7:20 PM
# lance7 said:

It took me ages to solve the problem. Thanks.

18 June 09 at 11:30 AM

Leave a Comment

Comment Policy: No HTML allowed. URIs and line breaks are converted automatically. Your e–mail address will not show up on any public page.

(required) 
(optional)
(required) 

  
Enter Code Here: Required
Page view tracker