I am working on a simple example, however I continue to get the following error upon execution:
I get this error when I create an XmlObjectFactory and call GetObject("Database"). This is what my configuration file looks like, any suggestions?Code: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.GetKeyValuePair(String connectionString, Int32 currentPosition, StringBuilder buffer, Boolean useOdbcRules, String& keyname, String& keyvalue)\r\n at System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey)\r\n at System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules)\r\n at System.Data.SqlClient.SqlConnectionString..ctor(String connectionString)\r\n at System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous)\r\n at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(String connectionString, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions)\r\n at System.Data.SqlClient.SqlConnection.ConnectionString_Set(String value)\r\n at System.Data.SqlClient.SqlConnection.set_ConnectionString(String value)
Code:<?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>


Reply With Quote