StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      


««12

BO ConstructorExpand / Collapse
Author
Message
Posted 02/10/2006 10:27:21 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 4:50:35 PM
Posts: 4,796, Visits: 4,766
Daniel,

More than likely it has to do with the connection.  Has any BO populated at all in this current service?  It would help to see the inner exception.  You can create a recursive loop on the catch while the InnerException is not NULL and print each exception to the control.  This would give a better idea.

Did you add a connection to the MicroFour.StrataFrame.Data.DataBasics.DataSources collection anywhere?  Since you are going through a service rather than a WinForm, you are responsible for setting up the connection within the service.  If you have not added a connection, then this is more than likely the problem.  You can add a connection as follows:

MicroFour.StrataFrame.Data.DataBasics.DataSources.Add("","server=localhost;Integrated Security=SSPI;Database=MyDataBase;")

Post #532
Posted 02/10/2006 11:26:44 AM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: Forum Members
Last Login: 05/25/2007 3:34:57 PM
Posts: 235, Visits: 309
I did:
System.Data.SqlClient.SqlConnectionStringBuilder loBuilder = new System.Data.SqlClient.SqlConnectionStringBuilder();
loBuilder.DataSource = _DdmServer;
loBuilder.InitialCatalog = _DdmDatabase;
loBuilder.UserID = _DdmLogin;
loBuilder.Password = _DdmPassword;

//-- Create a new data source item
//loNewDB = new SqlDataSourceItem(_DdmDatabase, loBuilder.ToString());
//-- Add the new database to the data source collection
DataLayer.DataSources.Add(new SqlDataSourceItem(_DdmDatabase, loBuilder.ToString()));


The innerException said something like "the DataSourceKey[] cannot be null."
Post #534
Posted 02/10/2006 1:24:50 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 4:50:35 PM
Posts: 4,796, Visits: 4,766
There is the problem.  When you create the SqlDataSourceItem, your first parameter is NULL.  The first parameter should be an empty string unless you are going to have more than one data source on the back end.  For example:

MicroFour.StrataFrame.Data.SqlDataSourceItem("","server=localhost;integrated security=SSPI;database=MyDatabase;")

Notice the first parameter is just an empty string.  By default all business objects DataSourceKey property is empty, which would be like the example above.  If you are going to have more than one type of connection, you may specify another connection and give a unique DataSourceKey (first parameter above) and then you would put that key name in the DataSourceKey property of the business object.  That would tell the business object which data connection to use.

I think this is where you are having the problem.  When using the WinForms and the Connection String Wizard, we manage this piece for you automatically.

Post #535
« Prev Topic | Next Topic »

««12

Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 9:48am

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.109. 10 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.