I've created a way to use whatever database in your application. It's easy in use and provides implementations for as well as SQL Server and Access at the moment. Could easily be expanded to (f.e.) MySQL, SyBase etcetera.
My question to you all is: is there something that could be made better? Or is there something I haven't thought of that is really important?
Structure is as follows: IDBGeneric is the standard interface. DBGeneric is the class that should be instantiated from the client. Via this class, each call to the methods in IDBGeneric is forwarded to the classes with the implementations for each diffferent provider (currently DBGenericSQLServer and DBGenericAccess). All enumerations are provided into the 'Enumerations' module. The structures used are DBGenericInfo (which takes care of the properties needed to create a connection to the database) and DBGenericSelect (which holds values to create an SQL statement that could be executed via a command).
What I like to know: do you like the idea I am providing here, or not, and why?
Please let me know via this forum. Thanx for taking a look at the code anyway.
Marco
ps: mods: because it's fully working code, I've posted it here...
** EDITED **:
forgot something: you have to create an access database and sql server database yourself...
Without even looking at your code, I'd suggest taking a look at DNN, these guys have done something like this. Also, I would suspect that there are other open-source applications or application blocks out there that provide database abstraction - you should probably research this topic quite a bit before formulating a working solution on your own.
Without even looking at your code, I'd suggest taking a look at DNN, these guys have done something like this. Also, I would suspect that there are other open-source applications or application blocks out there that provide database abstraction - you should probably research this topic quite a bit before formulating a working solution on your own.
I know DotNetNuke, have worked with it. I don't want to use work from others because I fully want to understand what is going on. And hardcoding it yourself is the only way to figure things out. If people want to do it also themselves, I think the code will be a good starting point, especially for working with the common System.Data interfaces... That's the reason I posted the code here. It's not complete yet, but a starting point...