locked
DAL. RRS feed

  • Question

  • I am trying to implement a data access to layer to work with both a SQL provider and an OLEDb provider. IE both my data sources are an oledb database(like a access mdb) and a sql server db.

    I know the level of abstraction that is always in question for this is a design decision. But I basically want to implement such that I may switch data sources with an easy change on the config file.

    I need more than a helper class that provides CRUD functions for me.

    Is there an article or code sample I could download to show an ideal Data Access Layer ?

    thanks

    Jaffery

    Tuesday, May 3, 2011 2:10 PM

Answers

  • You might want to Google or Bing on ".net generic data access". There is quite a bit of info out there.

    The most common method is to start with the base abstract class DbProviderFactory.

     


    Paul ~~~~ Microsoft MVP (Visual Basic)
    • Proposed as answer by Jackie-Sun Tuesday, May 17, 2011 4:43 AM
    • Marked as answer by Jackie-Sun Wednesday, May 25, 2011 7:21 AM
    Wednesday, May 4, 2011 1:15 PM
  • Hello Jaffery,

    Thanks for your post.

    A Data Access Layer is an important layer in the architecture of any software.  This layer is responsible for communicating with the underlying database.  Making this layer provider independent can ensure multi database support with ease.  This article discusses implementation of a provider independent Data Access Layer in C#. 

    In the article above, there are some code samples what you can refer to. I hope this can help you.

     

    Have a nice day,


    Jackie Sun [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Proposed as answer by Jackie-Sun Tuesday, May 17, 2011 4:43 AM
    • Marked as answer by Jackie-Sun Wednesday, May 25, 2011 7:21 AM
    Tuesday, May 17, 2011 4:43 AM

All replies

  • You might want to Google or Bing on ".net generic data access". There is quite a bit of info out there.

    The most common method is to start with the base abstract class DbProviderFactory.

     


    Paul ~~~~ Microsoft MVP (Visual Basic)
    • Proposed as answer by Jackie-Sun Tuesday, May 17, 2011 4:43 AM
    • Marked as answer by Jackie-Sun Wednesday, May 25, 2011 7:21 AM
    Wednesday, May 4, 2011 1:15 PM
  • Hello Jaffery,

    Thanks for your post.

    A Data Access Layer is an important layer in the architecture of any software.  This layer is responsible for communicating with the underlying database.  Making this layer provider independent can ensure multi database support with ease.  This article discusses implementation of a provider independent Data Access Layer in C#. 

    In the article above, there are some code samples what you can refer to. I hope this can help you.

     

    Have a nice day,


    Jackie Sun [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Proposed as answer by Jackie-Sun Tuesday, May 17, 2011 4:43 AM
    • Marked as answer by Jackie-Sun Wednesday, May 25, 2011 7:21 AM
    Tuesday, May 17, 2011 4:43 AM