|
-
Jan 21st, 2010, 12:45 AM
#1
Thread Starter
Addicted Member
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
-
Jan 21st, 2010, 01:27 AM
#2
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.
-
Jan 21st, 2010, 04:04 AM
#3
Thread Starter
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|