Should I have a separate method for Update(), Insert(), etc., or have a generic Query() that would be able to handle all of these?

Posted by Prayos on Programmers See other posts from Programmers or by Prayos
Published on 2012-10-04T16:58:48Z Indexed on 2012/10/04 21:52 UTC
Read the original article Hit count: 121

Filed under:
|
|
|

I'm currently trying to write a class library for a connection to a database. Looking over it, there are several different types of queries: Select From, Update, Insert, etc.

My question is, what is the best practice for writing these queries in a C# application?

Should I have a separate method for each of them(i.e. Update(), Insert()), or have a generic Query() that would be able to handle all of these? Thanks for any and all help!

© Programmers or respective owner

Related posts about c#

Related posts about database