.net MySQL&。NET:System.ArgumentException:初始化字符串的格式不符合从索引0开始的规范

.net MySQL&。NET:System.ArgumentException:初始化字符串的格式不符合从索引0开始的规范,.net,asp.net,subsonic,.net,Asp.net,Subsonic,我想使用亚音速,因为它说它将易于使用和节省时间 经过3个小时的努力,我准备放弃MySQL的连接字符串 Building configuration from C:\Documents and Settings\user\My Documents\Visual Studio 2 008\Projects\ConfigurationItems\ConfigurationItemsMVC\Web.config Adding connection to MySqlDataProvider ERROR:

我想使用亚音速,因为它说它将易于使用和节省时间

经过3个小时的努力,我准备放弃MySQL的连接字符串

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.
我无法转换以下内容:错误消息:System.ArgumentException:初始化字符串的格式不符合从索引0开始的规范

我每次尝试运行subsonic.exe/generate时都会得到它

这一切看起来很简单

这是我的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>


(其他连接字符串:“Server=localhost;Database=config;Uid=user;Pwd=password;”-还有“blah”/“anywhere”抛出相同的错误…)

没有快乐!非常接近于放弃亚音速。如果可以的话,请帮忙


顺便说一句,我使用的是亚音速2.2,我想它会在某个地方出现一个“
{0}
”,因为这就是你忘记时会出现的错误(IIRC)。

我是个白痴:

 <SubSonicService defaultProvider="ConfigDatabase">

应该是:

 <SubSonicService defaultProvider="MySqlDataProvider">


有关初始化字符串格式的更多信息,请查看此博客


您是指连接字符串中的字符串“{0}”吗?是的,您可能正在提供它,或者它正在寻找它。我伪造了默认的提供程序类-我想这是在更改字符串的格式,而不是在某个地方的引擎盖下提供“{0}”!