This question is locked. New answers and comments are not allowed.
I have a database that I want to "Save As" a file from my WPF program. I also want to be able to work offline against this saved file (no database connection to live database). The idea is to be able to design a system offline, and publish the system to the live database. The client would be remote from the database (meaning I cannot do a DB backup, nor would that work)
Some ideas I've thought about using are:
Serialize the entire database object tree (using EF or OA, or some other ORM) to a file, deserialize and work in memory against the objects. To publish, just clear out the database, then let the ORM save the objects back. The problem with this is that there will be a lot of work in creating serialized objects, keeping primary keys synced, and the size of the file created.
Use SQL CE, and create a new db file, create database tables, and write all objects to the new SQL CE database. For offline, just change the connection string to SQL CE. To publish, ... dunno? The problem with SQL CE is that EF doesnt like database generated keys, and has a very limited datatype selection which would force me to either translate (having two ORM objects one for SQL one for CE with different database types and keys), or re-design my live database to dumb it down for SQLCE (which I cannot do)
So, my question is: Does OA provide any semi-easy way to save all the data in its objects off to a file, and load them back in?
Thanks,
Brian
Some ideas I've thought about using are:
Serialize the entire database object tree (using EF or OA, or some other ORM) to a file, deserialize and work in memory against the objects. To publish, just clear out the database, then let the ORM save the objects back. The problem with this is that there will be a lot of work in creating serialized objects, keeping primary keys synced, and the size of the file created.
Use SQL CE, and create a new db file, create database tables, and write all objects to the new SQL CE database. For offline, just change the connection string to SQL CE. To publish, ... dunno? The problem with SQL CE is that EF doesnt like database generated keys, and has a very limited datatype selection which would force me to either translate (having two ORM objects one for SQL one for CE with different database types and keys), or re-design my live database to dumb it down for SQLCE (which I cannot do)
So, my question is: Does OA provide any semi-easy way to save all the data in its objects off to a file, and load them back in?
Thanks,
Brian