I've had great luck with OpenAccess in a web environment & I am having some issues doing it in a WinForms environment. I am using the ScopeFactory method to get my IObjectScope from the thread. My object scope is managed from a static class:
I am using SQL Server CE as my database, and am having an issue getting the data saved. I might be just overlooking this problem and thought I'd post this to see if someone can help me.
I have a form with a button that opens a form to create a new quarter. From this quarter form, here is my code to add a new quarter:
The Save function on Quarter Service adds the object to the object scope. Now when the form closes & returns to the parent form, I refresh a grid of "Quarters" where my recently created Quarter shows up. It appears it's saved in the DB, but when I close the application & view the DB it is empty. It seems to me that it should be added.
I don't know if my approach is way off as the ScopeFactory example doesn't show how to work with transactions (opening/committing) & I don't know what the practice is to handle these transactions for a WinForms app.
If anyone has any suggestions or sees something wrong with my approach, any help is greatly appreciated. As I said, I'm gotten OA to work great in my web application but this my first WinForms attempt with OA.
Thanks,
Mark