Solved

Stored Proc in BLL or DAL??

Posted on 2006-11-03
7
638 Views
Last Modified: 2008-02-26
I asked this question yesterday:
http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_22047143.html

That was a test code: testing my DAL Layer.

What I have is a class in BLL which calls a stored proc. The BLL is calling DAL for database connectivity stuff....

I was thinking about it...that class should be in DAL ..correct? I think DAL should call a stored proc, result is passed to BLL and BLL does whatever it needs to do and pass the result back to UI...

I dont think it's correct to have code in BLL to call stored procs or call database directly..is this correct?
0
Comment
Question by:Camillia
  • 4
  • 3
7 Comments
 
LVL 10

Expert Comment

by:bchoor
ID: 17868537
fdsfsdfsdf
0
 
LVL 7

Author Comment

by:Camillia
ID: 17868593

 Not funny.
0
 
LVL 10

Expert Comment

by:bchoor
ID: 17868600
I'd stick with the DAL for DB connectivity.

The test procedure you have in your DAL - is it just for testing purposes and will be removed before packaging. If so, you can look into using nUnit and other testing add-ons for VS. They will allow you to create a new project so keep any DB connectivity outside of the BLL.

HTH
~BC
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 10

Expert Comment

by:bchoor
ID: 17868605
oops--didn't realize that
0
 
LVL 7

Author Comment

by:Camillia
ID: 17868626
I do have database connectivity outside BLL, in DAL.

BUT, I have the test stored proc in my BLL not in DAL...and that's what i want to know moving forward...

Should I call stored proc/database "select"/"update"/"insert" from DAL or from BLL?
0
 
LVL 10

Accepted Solution

by:
bchoor earned 500 total points
ID: 17868752
yes, I would keep it in the DAL.

I'm a bit confused, what's the test stored procedure for?
0
 
LVL 7

Author Comment

by:Camillia
ID: 17869693
The test stored proc was to see if I can get results back from the DAL and if it connencts to SQL Server and IBM iSeries...

Then i thought about the 3-tier and was wondering where the stored proc belongs...

Never used nUnit, will look into to.
thanks
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question