using business objects in a service


Author
Message
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
thanks
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
DataLayer.DataSources is a shared (static) property, so it will always exist... You don't create an instance of the DataLayer, and then reference the DataSources property on it, you just access the shared DataSources property on the DataLayer class, just like it's written. The rest of your code looks good. Just make sure you call that code within the ServiceStart method (or whatever name it has) to ensure that the data source is added to that static collection.
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'm creating a service that needs to access several tables in a database. The service project includes a Strataframe Business Object Library but (obviously) no strataframe application. I have several questions:



1 - is the following correct:

System.Data.SqlClient.SqlConnectionStringBuilder loBuilder = new System.Data.SqlClient.SqlConnectionStringBuilder();

loBuilder.DataSource = _DdmServer;

loBuilder.InitialCatalog = _DdmDatabase;

loBuilder.UserID = _DdmLogin;

loBuilder.Password = _DdmPassword;



SqlDataSourceItem loNewDB;



//-- Create a new data source item

loNewDB = new SqlDataSourceItem(_DdmDatabase, loBuilder.ToString());



//-- Add the new database to the data source collection

DataLayer.DataSources.Add(loNewDB);



2 - How do I make sure that a data layer is created so that the last statement above will acturlaly refer to something?
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