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:
- Specifying path to webconfig using /config on the external tool path.
- Downgrading from the 6.0 .NET MySQL connector to the latest 5.2 version in line with samples.
- Adding MySQL.Data as a reference direct from the SubSonic folder to the DLL in there.
- 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