SubSonic Forums
All Your Database Are Belong To Us

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

Latest post 11-02-2008 5:59 PM by yitzchok. 1 replies.
  • 11-02-2008 3:48 PM

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

    I am attempting to use SubSonic in a new project.  I have an existing connection string in web.config which works fine with the ADO.NET code:

    <connectionStrings>

    <add name="mnl" providerName="System.Data.SqlClient" connectionString="Data Source=servername\instancename;Initial Catalog=dbname;User Id=xxx;Password=xxx;" />

    </connectionStrings>

     

    I have added the SubSonic sections to web.config...

     

    <configSections>

    <section name="SubSonicService" type="SubSonic.SubSonicSection, SubSonic" requirePermission="false" />

    </configSections>

     

    ...and...

    <SubSonicService defaultProvider="mnl">

    <providers>

    <clear />

    <add name="mnl" type="SubSonic.SqlDataProvider, SubSonic" connectionStringName="mnl" generatedNamespace="mnl" />

    </providers>

    </SubSonicService>

     

     

    When I attempt to generated code using this command line...

    sonic generate /out App_Code\DAL

     

     

    ... I get this error:

    No server name was passed in - please specify using /s MyServerName

    No Database name was passed in - please specify using /db MyDatabaseName

    sonic.exe v2.1.0.0 - Command Line Interface to SubSonic v2.1.0.0

    Usage:   sonic command [options]

    Sample:  sonic generate /server localhost /db northwind /out GeneratedFiles

    Help:    sonic help

    TIP:    SubSonic will read your App.Config or Web.Config - just select the project 

    and run your command.

     

    ERROR: Trying to execute generate

    Error Message: System.ArgumentException: Format of the initialization string does not conform to specification starting at index 0.

       at System.Data.Common.DbConnectionOptions.GetKeyValuePair(String connectionString, Int32 currentPosition, StringBuilder buffer, Boolean useOdbcRules, String& keyname, String& keyvalue)

       at System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey)

       at System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules)

       at System.Data.SqlClient.SqlConnectionString..ctor(String connectionString)

       at System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous)

       at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(String connectionString, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions)

       at System.Data.SqlClient.SqlConnection.ConnectionString_Set(String value)

       at System.Data.SqlClient.SqlConnection.set_ConnectionString(String value)

       at System.Data.SqlClient.SqlConnection..ctor(String connectionString)

       at SubSonic.SqlDataProvider.CreateConnection(String newConnectionString) in C:\svn\subsonicproject\trunk\SubSonic\DataProviders\SqlDataProvider.cs:line 220

       at SubSonic.SqlDataProvider.CreateConnection() in C:\svn\subsonicproject\trunk\SubSonic\DataProviders\SqlDataProvider.cs:line 210

       at SubSonic.AutomaticConnectionScope..ctor(DataProvider provider) in C:\svn\subsonicproject\trunk\SubSonic\Sql Tools\Connection.cs:line 172

       at SubSonic.SqlDataProvider.GetReader(QueryCommand qry) in C:\svn\subsonicproject\trunk\SubSonic\DataProviders\SqlDataProvider.cs:line 357

       at SubSonic.SqlDataProvider.GetTableNameList() in C:\svn\subsonicproject\trunk\SubSonic\DataProviders\SqlDataProvider.cs:line 866

       at SubSonic.DataService.GetTableNames(String providerName) in C:\svn\subsonicproject\trunk\SubSonic\DataProviders\DataService.cs:line 666

       at SubSonic.SubCommander.Program.GenerateTables() in C:\svn\subsonicproject\trunk\SubCommander\Program.cs:line 894

       at SubSonic.SubCommander.Program.Main(String[] args) in C:\svn\subsonicproject\trunk\SubCommander\Program.cs:line 78

    Execution Time: 102ms

     

     

  • 11-02-2008 5:59 PM In reply to

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

    I think what you should pass in to sonic is something like this

    sonic generate /config "location to app.config or web.config folder" /out App_Code\DAL

    If I am I because I am I, and You are You because You are You, then I am I, and you are you. But If I am I because You are You, and You are You because I am I, then I am not I and You are not You. -Rabbi of Kotzk

Page 1 of 1 (2 items) | RSS