nickp
02-10-2006, 02:37 AM
I am working on a simple example, however I continue to get the following error upon execution:
PropertyAccessExceptionsException (1 errors); nested PropertyAccessExceptions are: \n[Spring.Objects.MethodInvocationException: Property 'ConnectionString' threw exception., Inner Exception: System.ArgumentException: Format of the initialization string does not conform to specification starting at index 0.\r\n at System.Data.Common.DbConnectionOptions.GetKeyValue Pair(String connectionString, Int32 currentPosition, StringBuilder buffer, Boolean useOdbcRules, String& keyname, String& keyvalue)\r\n at System.Data.Common.DbConnectionOptions.ParseIntern al(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey)\r\n at System.Data.Common.DbConnectionOptions..ctor(Strin g connectionString, Hashtable synonyms, Boolean useOdbcRules)\r\n at System.Data.SqlClient.SqlConnectionString..ctor(St ring connectionString)\r\n at System.Data.SqlClient.SqlConnectionFactory.CreateC onnectionOptions(String connectionString, DbConnectionOptions previous)\r\n at System.Data.ProviderBase.DbConnectionFactory.GetCo nnectionPoolGroup(String connectionString, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions)\r\n at System.Data.SqlClient.SqlConnection.ConnectionStri ng_Set(String value)\r\n at System.Data.SqlClient.SqlConnection.set_Connection String(String value)
I get this error when I create an XmlObjectFactory and call GetObject("Database"). This is what my configuration file looks like, any suggestions?
<?xml version="1.0" encoding="utf-8" ?>
<objects xmlns="http://www.springframework.net">
<object name="Database"
singleton="false"
type="SpringDemo.Database, SpringDemo">
<property name="Connection" ref="SqlConnectionObject" />
<property name="Command" ref ="SqlCommandObject" />
</object>
<object name="SqlConnectionObject"
singleton="false"
type="System.Data.SqlClient.SqlConnection, System.Data">
<property name="ConnectionString" value ="Testing" />
</object>
<object name="SqlCommandObject"
singleton="false"
type="System.Data.SqlClient.SqlCommand, System.Data">
</object>
</objects>
PropertyAccessExceptionsException (1 errors); nested PropertyAccessExceptions are: \n[Spring.Objects.MethodInvocationException: Property 'ConnectionString' threw exception., Inner Exception: System.ArgumentException: Format of the initialization string does not conform to specification starting at index 0.\r\n at System.Data.Common.DbConnectionOptions.GetKeyValue Pair(String connectionString, Int32 currentPosition, StringBuilder buffer, Boolean useOdbcRules, String& keyname, String& keyvalue)\r\n at System.Data.Common.DbConnectionOptions.ParseIntern al(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey)\r\n at System.Data.Common.DbConnectionOptions..ctor(Strin g connectionString, Hashtable synonyms, Boolean useOdbcRules)\r\n at System.Data.SqlClient.SqlConnectionString..ctor(St ring connectionString)\r\n at System.Data.SqlClient.SqlConnectionFactory.CreateC onnectionOptions(String connectionString, DbConnectionOptions previous)\r\n at System.Data.ProviderBase.DbConnectionFactory.GetCo nnectionPoolGroup(String connectionString, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions)\r\n at System.Data.SqlClient.SqlConnection.ConnectionStri ng_Set(String value)\r\n at System.Data.SqlClient.SqlConnection.set_Connection String(String value)
I get this error when I create an XmlObjectFactory and call GetObject("Database"). This is what my configuration file looks like, any suggestions?
<?xml version="1.0" encoding="utf-8" ?>
<objects xmlns="http://www.springframework.net">
<object name="Database"
singleton="false"
type="SpringDemo.Database, SpringDemo">
<property name="Connection" ref="SqlConnectionObject" />
<property name="Command" ref ="SqlCommandObject" />
</object>
<object name="SqlConnectionObject"
singleton="false"
type="System.Data.SqlClient.SqlConnection, System.Data">
<property name="ConnectionString" value ="Testing" />
</object>
<object name="SqlCommandObject"
singleton="false"
type="System.Data.SqlClient.SqlCommand, System.Data">
</object>
</objects>