﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Business Objects and Data Access (How do I?)  » using business objects in a service</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 13:57:14 GMT</lastBuildDate><ttl>20</ttl><item><title>using business objects in a service</title><link>http://forum.strataframe.net/FindPost516.aspx</link><description>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:&lt;br&gt;
&lt;br&gt;
1 - is the following correct:&lt;br&gt;
                System.Data.SqlClient.SqlConnectionStringBuilder loBuilder = new System.Data.SqlClient.SqlConnectionStringBuilder();&lt;br&gt;
                loBuilder.DataSource = _DdmServer;&lt;br&gt;
                loBuilder.InitialCatalog = _DdmDatabase;&lt;br&gt;
                loBuilder.UserID = _DdmLogin;&lt;br&gt;
                loBuilder.Password = _DdmPassword;&lt;br&gt;
                &lt;br&gt;
                SqlDataSourceItem loNewDB; &lt;br&gt;
&lt;br&gt;
                //-- Create a new data source item&lt;br&gt;
                loNewDB = new SqlDataSourceItem(_DdmDatabase, loBuilder.ToString());&lt;br&gt;
&lt;br&gt;
                //-- Add the new database to the data source collection&lt;br&gt;
                DataLayer.DataSources.Add(loNewDB);&lt;br&gt;
&lt;br&gt;
2 - How do I make sure that a data layer is created so that the last statement above will acturlaly refer to something?</description><pubDate>Tue, 07 Feb 2006 15:35:31 GMT</pubDate><dc:creator>Daniel Essin</dc:creator></item><item><title>RE: using business objects in a service</title><link>http://forum.strataframe.net/FindPost521.aspx</link><description>thanks</description><pubDate>Tue, 07 Feb 2006 15:35:31 GMT</pubDate><dc:creator>Daniel Essin</dc:creator></item><item><title>RE: using business objects in a service</title><link>http://forum.strataframe.net/FindPost517.aspx</link><description>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.</description><pubDate>Mon, 06 Feb 2006 15:18:42 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item></channel></rss>