简体   繁体   中英

Windows forms application with database publishing

I'll try to keep the question simple and short - what are the best practices when publishing a windows forms application which is using a SQL Server database?

Using ClickOnce with prerequisites I can enforce SQL Server Express installation, but what if it's already installed? How do you build the connection string? How do you find the names of the instances of the server? What kind of authentication should be used - Windows or SQL? Can this process be automated or is user interaction inevitable?

Adding an answer since this is the way you decided to go anyway, glad to help :)

You could also consider using SQL Server Compact which requires no setup and runs directly in-process with your application. Of course does not offer all features of SQL Express so really depends on your needs.

Have a look at: Microsoft SQL Server Compact 4.0

Note: if you could easily get rid of your triggers either you have cut functionalities or you got rid of things you do not really needed. I am old school and never use triggers, they are ofthen misused, seen people creating triggers just to set a default value in a column because did not know could have used the default.

嗯,在这种情况下,我要说的是,如果数据库连接到支持许多用户身份验证的网络,并且必须面对某种用户交互,那么您将不得不考虑使用数据库。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM