I have a C# Windows Forms application, whose prototype was created on SQL Server (strongly-typed dataset). In its final version, the application must be able to work over SQL Server, MySQL or Oracle.
Now I am wondering which parts (if any) can be reused from the prototype. 1. Dataset (typed) ? 2. TableAdapters? (probably not, they contain SQL Server-specific syntax) 3. Bindings to DataGridViews
Most importantly, if we need to re-implement all this, is there a way to do this at design-time? Or, 1. do we need to programmatically create untyped-dataset? 2. do we need to programmatically create its data adapters (or table adapters)? If yes, which of the two? 3. do we need to programmatically create its bindings to the datagridviews of the interface?
Perhaps irrelevant: if we create a entity model (AFAIK it provides db independence) from the existing db schema, could we use this somehow to create bindings to our datagridviews?
Thank you!
So, in order to keep our Bindings and dataGridViews, as well as some additional logic we have implemented, should we throw away all the generated TableAdapters and write them manually? If we do throw them away, should we use DataAdapters instead?
Is this a "by-the-book" approach? Has anyone done something like this?
More generally, if you need to create a Forms application to work in multiple dbs, would you do it: A. with untyped dataset, dataadapters/tableadapters and bindings created by hand B. somehow generate a vendor-independent dataset and dataadapters/tableadapters (how?) and bind them at design time through the VS gui C. some other way???
UPDATE:
So, in order to keep our Bindings and dataGridViews, as well as some additional logic we have implemented, should we throw away all the generated TableAdapters and write them manually? If we do throw them away, should we use DataAdapters instead?
Is this a "by-the-book" approach? Has anyone done something like this?
More generally, if you need to create a Forms application to work in multiple dbs, would you do it: A. with untyped dataset, dataadapters/tableadapters and bindings created by hand B. somehow generate a vendor-independent dataset and dataadapters/tableadapters (how?) and bind them at design time through the VS gui C. some other way???
My advice:
What I always do to answer the rest of the questions
Rewriting the adapters looks hard but is actually pretty doable.