473,396 Members | 1,989 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Retrieving child data in DAL or BLL

hi all,

If i have a table in my database, and that table contains foreign keys
to other tables, should i extract the data from the other tables at the
same time, or should my business layer call the separate DAL retrieve
methods for each child object?

if i take the example of a company and contact, my contact table
contains a foreign key pointing to the company table.

Now if i want to retrieve the details of the company at the same time
as retrieving the details of the contact, should the DAL call the
CompanyDataService and retrieve that companies details?

Or do i just return the Contact data to the business layer and then my
business layer would call the CompanyDataService to obtain the data for
the company??

If anyone could write a very very short example, to help me understand
i would really appreciate it. Ta

Sep 27 '06 #1
2 1185
Hi,

You've started 3 related threads in this newsgroup over the past 2 days and I responded to the last two but haven't yet received a
reply. If you have any concerns with my answers to your questions then post a reply and I'll try to address them. Also, you might
want to keep all of these posts on a single thread since they are very closely related. People will read each reply in a single
thread and I'm sure they'll be happy to respond with their thoughts on the matter. By keeping the posts together it will help to
make your questions clearer since previous posts will provide a background for newer ones.

That said, I believe I addressed these questions already in your last thread. If you have any questions about my answers, reply to
me in your last thread.
If anyone could write a very very short example, to help me understand
i would really appreciate it. Ta
I found the following article on MSDN. It seems to address some of your questions with explanations and examples. However, the
examples in the article return a DataTable through the BL and my recommendation is to encapsulate the data in the BL wherever
possible and to create business objects to represent logical entities. Binding was somewhat difficult in VS.NET 2003 without access
to the underlying data structures, however in VS.NET 2005 this is no longer an issues because the designer now supports binding
directly to objects. For this reason the article is a bit out-dated, but it may help.

Building an N-Tier application in .NET (MSDN):
http://msdn.microsoft.com/library/de...asp?frame=true

HTH

--
Dave Sexton
Sep 27 '06 #2
Dave, i am sorry just had so many tings going on, didnt think, thanks
for the answer though, i will read it now

Sep 27 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Bjorn | last post by:
Hi all, Can't seem to figure out how to retrieve the text of a node with multiple child nodes (and I just want the text of the parent, not the InnerText or InnerXML that comes with it). My...
3
by: melanieab | last post by:
Hi, I can't seem to get the syntax correct. I have an xmlnodelist full of elements called "file". Each file has an attribute called "ID". If I just want to get, say, the ID of the second file...
3
by: Justin | last post by:
I have created a dataset with two tables and an insert command, I need to be able to retreive the Key Identity after inserting into table "A" for use in table "B". Should I use ExecuteScalar()...
1
by: Glenn T. Kitchen | last post by:
Dear Group, I'm having problems retrieving the child rows of a parent row. The parent table is Users and the child table is Addresses. I used the Schema to create a DataRelation between the...
0
by: Andy | last post by:
Hi All. I'm working for a company that has set out a guideline for retrieving data from a database. Nobody can explain to me the reason for the following. When retrieving a set of records...
1
by: jimmyfo | last post by:
Hi, I recently wrote an ASP.Net web application in VS2005 and published (using VS2005 Publish feature) it to a relatively clean machine with ASP.Net 2.0 and MDAC 2.8 installed on it. However, when...
11
by: Nemisis | last post by:
Hi everyone, sorry if this post gets really long, i just wanna make sure i fully explain what i am trying to do. I am new to OOP and .net 2.0, so if this is obvious, i am sorry. I have wrote a...
1
by: Pathik | last post by:
Hi All, I have to get the values of "reading" and "value" elements of context Person/Category/Group/ser.These values must be on condition based,means I have to get the values of "reading" and...
5
by: Sanjay Pais | last post by:
I have a table with over 1.3 million rows. I am retrieving only 20 at a time using the with - over clauses In query analyser, the data is retrieved in under a second. When retrieving using the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.