Create installer for winForms with local DB

后端 未结 2 728
情深已故
情深已故 2021-01-14 02:53

I have a Winforms application (checkers game) which have a local DB (using SQL Server Express) to save the registered players and their scores..

I\'m trying to crea

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-14 03:41

    This is my workaround in wpf. I think solution is the same in Winform:

    1. Make your mdf file "content" by right clicking on that and select properties. In "build action" menu select "content". And in copy to output directory select copy always

    2. In Solution explorer go to Properties/Settings.Settings and put connection strings in a field (notice that name of that must be the same as it is in your App.config (eg in wpf) like picture below it will create).

    1. Right click in your setup project and Add->Project output-> then select content files.

提交回复
热议问题