locked
Creating DAL RRS feed

  • Question

  • User-1129879462 posted

    Hello,

    We use only SPs for CRUD operations

    I want to create strongly typed DAL with less effort

    I am using VS2K8 with MS SQL 2K8

    I have already explored LINQ and would like to explore other options available

    Thank you

    Regards
    Raj 

    Wednesday, February 9, 2011 6:12 AM

Answers

  • User-952121411 posted

    It seems, using SP is too tricky in EF compared LinqToSQL

    Just know in terms of Microsoft ORMs, L2S is not the flagship anymore and is not actively being enhanced; the team at Microsoft on L2S is only for support (heard this at 2 different VSLive Conferences, and read on MSDN blog) - all efforts are on building The Entity Framework.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, February 17, 2011 10:16 PM

All replies

  • User-443671128 posted

    Hi,

    You can use T4 Templates to autogenerate DAL fully.

    Wednesday, February 9, 2011 7:22 AM
  • User-1129879462 posted

    Hi Rajesh,

    Seems good, let me check

    Thanks indeed

     

    Wednesday, February 9, 2011 10:48 AM
  • User43093768 posted

    Is there any special reason that you are inclined towards SP?

    Wednesday, February 9, 2011 2:53 PM
  • User-1129879462 posted

    1. Coz, all our CRUD operations are performed using SP 

    2. Easy maintenance & deployment

    3. Changes can be done easily

    4. Easy to maintain data base integrity

    Wednesday, February 9, 2011 11:23 PM
  • User-1129879462 posted

    Whether typed datasets/TableAdapters will help me?!

     

    Wednesday, February 9, 2011 11:43 PM
  • User-952121411 posted

    What about using the EntityFramework - you will have auto generated entities (classes) based on your database, and you can also used stored procedures as well. I believe you can remap the EF Model to your CRUD SPs.

    Entity Framework Modeling: Select Stored Procedures:

    http://www.robbagby.com/entity-framework/entity-framework-modeling-select-stored-procedures/

     

    Wednesday, February 16, 2011 5:18 PM
  • User-443671128 posted
    Hi, You can also go for Entity Framework 4.0. And if Entity Framework is OK with you then you can use POCO T4 Templates & generate entities. Also you can use T4 Templates to generate Insert, Update, Delete, GetAll, GetByID methods auto generated for all the tables present in your DB. Now you need to again generate Service Layer or you can say Business Logic Layer which is only calling mechanism to DAL or we can consider it as wrapper on DAL. You can make this one auto-generated as well. T4 makes life easier...
    Thursday, February 17, 2011 7:27 AM
  • User-1129879462 posted

    It seems, using SP is too tricky in EF compared LinqToSQL

    Thursday, February 17, 2011 7:37 AM
  • User-443671128 posted

    yes it is tricky but once you got command over that it will be easier for you...

    there are lots of advantages of EF over linq to sql

    between linq to sql and EF i prefer EF, the rest is upon you...

    one query?

    do you want to develop your project with all general methods like insert, update delete etc with sp based or some of the sps like for complex search?

     

    Thursday, February 17, 2011 7:43 AM
  • User-1129879462 posted

    No, for CURD operations, we write our own SPs havin lot of business logic in it

    Thursday, February 17, 2011 7:45 AM
  • User-952121411 posted

    It seems, using SP is too tricky in EF compared LinqToSQL

    Just know in terms of Microsoft ORMs, L2S is not the flagship anymore and is not actively being enhanced; the team at Microsoft on L2S is only for support (heard this at 2 different VSLive Conferences, and read on MSDN blog) - all efforts are on building The Entity Framework.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, February 17, 2011 10:16 PM