如何在另一台PC上以相同的安装方式将Winform C#应用程序与数据库一起部署? [英] How to deploy winform C# application with database in same instalation on another PC's?

查看:238
本文介绍了如何在另一台PC上以相同的安装方式将Winform C#应用程序与数据库一起部署?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

0
down vote
favorite
I develope c# windows form application in visual studio 2015 who is connected to a sql server express 2014, application with simple read and write data to database who have only one table, and now I want to put both in same instalation and deploy it on another PC's with OS Windows 10, so user can install application with one click setup, next, next, finish. How can I do it? I need step by step, because I read a lot of articles and do some of the examples and no one work. Is it better to use SQL Server Compact or SQLite, to use Visual Studio Installer or Advanced Installer, do I must write a scripts or can do it with ssdt or give me any other sugestion. Thanks in advance!



我尝试过的事情:

我尝试使用Visual Studio Installer和Advanced Installer,尝试使用ssdt在相同的解决方案winform和数据项目中创建并一起构建它,但无济于事!



What I have tried:

I tried with Visual Studio Installer and Advanced Installer, I try with ssdt to create in same solution winform and data project and to together build it but nothings work!

推荐答案

最简单的方法可能是使用ClickOnce安装并将SQL Server添加为先决条件,请参见: ClickOnce部署vs.requestedExecutionLevel = requireAdministrator [ Inno使用工具安装SQL Server 2008 R2的安装脚本 [ SQL Server 2012 Express LocalDB入门 [所有SQL Server Compact:SQL Server Compact,SQLite,SQL Server Express和LocalDB的比较 [
The easiest way might be to use a ClickOnce installation and add SQL Server as a prerequisite, see: ClickOnce - Quick steps to Deploy, Install and Update Windows Based Client Applications[^] and: ClickOnce deployment vs. requestedExecutionLevel = requireAdministrator[^]

In general it is not recommended to deliver SQL Server with your application, but sometimes you have no other option.
See this tip for an SQL Server 2008 R2 installer: Inno Setup Script to Install SQL Server 2008 R2 with Tools[^]

But as your needs are simple, you can also use localDB which is only about 33 Mb: Getting Started with SQL Server 2012 Express LocalDB[^]

Here is a comparison of SQL Server Compact, SQLite, SQL Server Express and LocalDB: Everything SQL Server Compact: Comparison of SQL Server Compact, SQLite, SQL Server Express and LocalDB[^]


这篇关于如何在另一台PC上以相同的安装方式将Winform C#应用程序与数据库一起部署?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆