Bit weird to use multiple db formats but anyway...
I'd make an interface class then inherit from that and override dependant on
which db.
so say interface was called MyInterface
public class dbAccess : MyInterface //inherit interface
public class dbEnterprise : MyInterface //inherit interface
then when u wanna use the access one:
MyInterface m = new dbAccess();
or the enterprise one
MyInterface m = new dbEnterprise();
And that ofcourse can neatly be used with the factory pattern.
then ur code for your method calls for both enterprise and access versions
will not change.
"Qingdong Z." <Qi*******@discussions.microsoft.comwrote in message
news:83**********************************@microsof t.com...
>I know this is a silly question, but I am looking for the best way.
I build a windows application with standard version and enterprise
version.
Standard version use local SQL/Access as database. Enterprise version use
Centralized Web Service as Database. Which is the easiest way to handle
this?
I have too many classes have data access.
I can create following classes, How could I use Interface or other ways to
call right DB?
class1
class1_db_sql
class1_db_access
class1_db_webservice