BO Constructor


Author
Message
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
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;")

Daniel Essin
Daniel Essin
StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)
Group: Forum Members
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."
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
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.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search