M
Milsnips
Hi there,
this is what i'm trying to achieve, i have separate identical classes for
SqlClient, OracleClient, Odbc and OleDb, what i want is to create a Wrapper
class that calls any of these 4 based on the user connection.... so what i
had in mind was something like this:
Application starts and prompts user to create a database connection.
User selects "Oracle" connect, so i set a parameter in the generic wrapper,
"activeConnection" = oracle (or from enum selection).
Now from here on, i should only have to access the generic wrapper,
eg..something like:
//assuming this is all i need to point the wrapper in the right direction//
GenericDataWrapper x = new GenericDataWrapper();
x.activeConnection = ConnectType.Oracle
x.Connect("connectionstring goes here"...); - we stop here..
So, at the point where x references a procedure, i want the generic wrapper
to go to MyClass.Data.OracleClient.Connect(), if you get the drift of where
i'm coming from.
Does this mean that in the generic class i have to use a switch statement
for every function call, so i point it internally to the right class or is
there a cleaner way with less code here?
any help appreciated.
thanks,
Paul
this is what i'm trying to achieve, i have separate identical classes for
SqlClient, OracleClient, Odbc and OleDb, what i want is to create a Wrapper
class that calls any of these 4 based on the user connection.... so what i
had in mind was something like this:
Application starts and prompts user to create a database connection.
User selects "Oracle" connect, so i set a parameter in the generic wrapper,
"activeConnection" = oracle (or from enum selection).
Now from here on, i should only have to access the generic wrapper,
eg..something like:
//assuming this is all i need to point the wrapper in the right direction//
GenericDataWrapper x = new GenericDataWrapper();
x.activeConnection = ConnectType.Oracle
x.Connect("connectionstring goes here"...); - we stop here..
So, at the point where x references a procedure, i want the generic wrapper
to go to MyClass.Data.OracleClient.Connect(), if you get the drift of where
i'm coming from.
Does this mean that in the generic class i have to use a switch statement
for every function call, so i point it internally to the right class or is
there a cleaner way with less code here?
any help appreciated.
thanks,
Paul