I'm stuck while developing a small desktop Project Management application in C# (VS2019).
My solution would have two projects in it:
- a library project (models, classes, XSD datasets...), and the
- application project (forms, other classes closely related to the application)
In the application project I'd use data objects (i.e. datagridviews, bindingnavbars, and so on) for the BL implementation.
I'm already developing a similar project based on SQL Server DB, but this small project should go serverless. So I thought that an MDF file could meet my needs.
When I run the published project, things go awry: the connection string is pointing the MDF in an absolute path within the vs project folder.
MY QUESTIONS ARE:
1. is using XSD to access MDF actually a good choice?
2. can I have the program create a MDF file in runtime (in a folder of user's choice)?
3. can the connection string be edited in runtime in order to "switch" database as needed?
What I have tried:
I added a new component > Data > MDF in the library project and I started adding tables in the MDF through the Server Panel. Then I added tableadapters in the dataset (draggin the tables directly from the Server Panel), made the databindings for the CRUD operations in the application project's forms... everything just works while debugging withing the IDE.