2

I wanted to use SubSonic as it said it would be easy to use and a time saver.

After 3 hours trying to get the connection string for MySQL right I'm about to give up on it.

Building configuration from C:\Documents and Settings\user\My Documents\Visual Studio 2

008\Projects\ConfigurationItems\ConfigurationItemsMVC\Web.config
Adding connection to MySqlDataProvider
ERROR: Trying to execute generate
Error Message: System.ArgumentException: Format of the initialization string does not conform to specification starting at index 0.

I can't shift this: Error Message: System.ArgumentException: Format of the initialization string does not conform to specification starting at index 0.

I get it every time I try and run subsonic.exe /generate

IT ALL LOOKED SO EASY!!!

Here is my Web.Config

<!-- connectionString="Persist Security Info=False;database=config;server=localhost;user id=config;Password=config" -->
  <connectionStrings>
    <remove name="ConfigConnectString"/>
    <add name="ConfigConnectString" connectionString="Persist Security Info=False;database=config;server=localhost;user id=userid;Password=password" providerName="MySql.Data.MySqlClient"
      />
    </connectionStrings>

  <SubSonicService defaultProvider="ConfigDatabase">
      <providers>
        <add type="SubSonic.MySqlDataProvider, SubSonic" 
             name="MySqlDataProvider" 
             generatedNamespace="Config" 
             connectionStringName="ConfigConnectString" 
             />

      </providers>
  </SubSonicService>

I've tried a few things:

  1. Specifying path to webconfig using /config on the external tool path.
  2. Downgrading from the 6.0 .NET MySQL connector to the latest 5.2 version in line with samples.
  3. Adding MySQL.Data as a reference direct from the SubSonic folder to the DLL in there.
  4. Trying various formats for the connection string, based off http://www.connectionstrings.com/mysql#28

( other connection string: "Server=localhost;Database=config;Uid=user;Pwd=password;"- also "blah" / "anything" throws the same error...)

No joy! Very close to giving up on SubSonic. Please help if you can!

Btw I am using Subsonic 2.2

3 Answers 3

7

I'm an idiot:

 <SubSonicService defaultProvider="ConfigDatabase">

Should be:

 <SubSonicService defaultProvider="MySqlDataProvider">

Doh!

Sign up to request clarification or add additional context in comments.

Comments

1

I guess it expects a '{0}' somewhere, as that is the error you get when you forget (IIRC).

3 Comments

do you mean the string '{0}', within the connection string?
Yes, you are probably supplying it, or it is looking for that.
I had fudged the default provider class - I suppose that was changing the format of the string somewhere down the line and not providing a '{0}' under the bonnet somewhere!
1

Check this Blog for More Information about Format Of the Initialization string

http://menononnet.wordpress.com/2008/02/23/format-of-the-initialization-string-does-not-conform-to-specification-starting-at-index-0/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.