Reputation: 193282
c:\temp\wpftool.exe
c:\temp\wpftool.mdf
databasec:\Users\jim\documents\checkout\wpftool.exe
, the application reads and writes to the same database in that directory (c:\Users\jim\documents\checkout\wpftool.mdf
)What is the best way to create a WPF application that supports the above scenario?, considering:
Upvotes: 0
Views: 1200
Reputation: 33379
For the database, I would look into using the "user instance" feature in SQL Express. Combined with the |DataDirectory| substitution string support it makes it very easy for your application to get hooked up.
In all honesty I have not deployed a ClickOnce app leveraging this approach myself yet, but I just thought I would bring it to your attention because it's what I would look into myself if I was building something like you described.
Upvotes: 1
Reputation: 40289
Some points on the database side:
Assuming the "New user" already has SQL installed, they'd need to attach the (newly copied) database. Besides having sufficient access rights to attach a database, your application would need to configure the call to include the drive\folder containing the database files. If your .exe can identify it's "new home folder" on the fly, you should be able to work that out.
Define "reasonable security". Any database file I get, I can open, review, and ultimately figure out (depends on how obscure the contents are). Can you obfuscate your data, such as using table "A" instead of "Customer"? Would you really want to? The best possible security involves data encryption, and managing that--and in particular, the encryption keys--can be a pretty advanced subject, depending on just how "secure" you want your data to be.
Upvotes: 1