Link to home
Start Free TrialLog in
Avatar of Camillia
CamilliaFlag for United States of America

asked on

Stored Proc in BLL or DAL??

I asked this question yesterday:
https://www.experts-exchange.com/questions/22047143/Passing-data-from-Buisness-Layer-to-UI-Layer.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?
Avatar of bchoor
bchoor
Flag of United States of America image

fdsfsdfsdf
Avatar of Camillia

ASKER


 Not funny.
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
oops--didn't realize that
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?
ASKER CERTIFIED SOLUTION
Avatar of bchoor
bchoor
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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