Results 1 to 3 of 3

Thread: Base Class for Connecting the database

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2009
    Posts
    135

    Base Class for Connecting the database

    Hi to all,

    i just like to know how create a base class for connecting the database.just the simple one.

    what are the best practice in creating a base class connection.please show me some example.or if you have links there pls share some..it would be appreciated..i want your comments guys.

    many thanks
    glen

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Base Class for Connecting the database

    I'm not quite sure what you're asking for. There's already a base class for connecting to a database, i.e. DbConnection. It's the derived classes that you actually use to connect to a specific database though, e.g. SqlConnection or OleDbConnection.

    If you mean that you want to create your own data access layer, which handles all the getting and saving of data in the database, then there are all sorts of ways you can do it. You first need to decide how you're actually going to access the data. Are you going to use ADO.NET? If so, are you going to write all your SQL inline or use stored procedures? Are you going to use a typed DataSet? If you're not going to use ADO.NET then will you use LINQ to SQL, the Entity Framework or something else? Etc, etc.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Aug 2009
    Posts
    135

    Resolved Re: Base Class for Connecting the database

    Hello jm, thanks for the quick response.

    If you mean that you want to create your own data access layer, which handles all the getting and saving of data in the database, then there are all sorts of ways you can do it.
    Yes,ur right i want to create my own data access layer.

    Are you going to use ADO.NET?
    yes,i used ado.net

    If so, are you going to write all your SQL inline or use stored procedures?
    about this,what would be the best or more efficient..if i used stored proc..do i need to put all my queries in stored proc..or there is some queries that no need put in stored procedures..

    [QUOTE]
    Are you going to use a typed DataSet?
    [/QUUOTE]
    am not sure bout this..what would be your suggestion regarding this..for developing medium application..and what are the other option if i not use dataset.

    Can explain to me what is Entity framework?.when is the time to use this..is this good for medium application development?..please tell me more info in creating own data access layer..

    Thanks,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width