开发者

Log4Net Database fun - connection strings!

开发者 https://www.devze.com 2023-01-12 19:31 出处:网络
This works on dev: <connectionString name=\"asdf\" value=\"Data Source=.\\;Initial Catalog=fmwebapp1;Integrated Security=True\" />

This works on dev:

 <connectionString name="asdf" value="Data Source=.\;Initial Catalog=fmwebapp1;Integrated Security=True" />
      <connectionType value="System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

On live (a 64 bit VPS) this doesn't work:

<connectionString value="CT210991\SQLEXPRESS;Initial Catalog=fmwebapp1;Integrated Security=True" />
      <connectionType value="System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=ne开发者_Python百科utral, PublicKeyToken=b77a5c561934e089" />

Error is:

log4net:ERROR [AdoNetAppender] Could not open database connection [CT210991\SQLEXPRESS;Initial Catalog=fmwebapp1;Integrated Security=True]
System.ArgumentException: Keyword not supported: 'ct210991\sqlexpress;initial catalog'.
   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 log4net.Appender.AdoNetAppender.InitializeDatabaseConnection()

brain gone fuzzy.. 64 bit issue?


You don't have 'Data Source=' in front of 'CT210991\SQLEXPRESS' in your connectionString value.


You're missing the "Data Source" bit:

<connectionString value="Data Source=CT210991\SQLEXPRESS;Initial Catalog=fmwebapp1;Integrated Security=True" />
0

精彩评论

暂无评论...
验证码 换一张
取 消