[英]How to deploy application with sql server database on clients
I have designed an accounts software for my clients.我为我的客户设计了一个账户软件。 I used SQL Server 2008 database with Stored Procedures.我将 SQL Server 2008 数据库与存储过程一起使用。 It is developed in Visual Studio 2010, .NET Framework 3.0.它是在 Visual Studio 2010、.NET Framework 3.0 中开发的。 I have more than 500 clients using Windows 7.我有 500 多个使用 Windows 7 的客户端。
The major problem is:主要问题是:
Is SQL Server runtime automatically installed with .NET Framework? SQL Server 运行时是否随 .NET Framework 自动安装? As MS Access database does not required Office to be installed on client.由于 MS Access 数据库不需要在客户端上安装 Office。
I can not installed SQL Server 2008 on each client, it is a tough job.我不能在每个客户端上都安装 SQL Server 2008,这是一项艰巨的工作。 Also the clients are not having a good knowledge of installation process.此外,客户对安装过程没有很好的了解。
How to run SQL Server database on clients without installing its setup on clients?如何在客户端上运行 SQL Server 数据库而不在客户端上安装其设置? Is there any runtime files or setup?是否有任何运行时文件或设置?
Using Visual Studio you can create a setup project and install prerequisites that you need during installation.使用 Visual Studio,您可以创建安装项目并安装安装过程中所需的先决条件。
The installation process is very simple and the end user can install application and prerequisites after clicking next buttons.安装过程非常简单,最终用户可以在单击下一步按钮后安装应用程序和先决条件。
Here are the steps for Creating a Setup Project:以下是创建安装项目的步骤:
1- Create ac# Windows Forms Application 1- 创建 ac# Windows 窗体应用程序
2- Create a Setup Project 2- 创建一个安装项目
It's that easy.就这么简单。
For more information take a look at following docs articles:有关更多信息,请查看以下文档文章:
Using Visual Studio another option is using ClickOnce publishing.使用 Visual Studio 的另一个选择是使用 ClickOnce 发布。
To do so, in properties of your project, in publish tab, click prerequisites button, you can select SQL Express in prerequisites.为此,在您的项目属性中,在发布选项卡中,单击先决条件按钮,您可以在先决条件中选择 SQL Express。 This way, you only need to set your database files to copy in output directory, and use AttachDbFileName in connection string: Data Source=.\\SQLEXPRESS; AttachDbFilename=|DataDirectory|\\Database.mdf; Initial Catalog=Master"
这样,您只需要将您的数据库文件设置为复制到输出目录中,并在连接字符串中使用 AttachDbFileName: Data Source=.\\SQLEXPRESS; AttachDbFilename=|DataDirectory|\\Database.mdf; Initial Catalog=Master"
Data Source=.\\SQLEXPRESS; AttachDbFilename=|DataDirectory|\\Database.mdf; Initial Catalog=Master"
Data Source=.\\SQLEXPRESS; AttachDbFilename=|DataDirectory|\\Database.mdf; Initial Catalog=Master"
. Data Source=.\\SQLEXPRESS; AttachDbFilename=|DataDirectory|\\Database.mdf; Initial Catalog=Master"
。
For more information take a look at the following docs article:有关更多信息,请查看以下文档文章:
LocalDB
is Microsoft's current recommended solution. LocalDB
是 Microsoft 当前推荐的解决方案。 It allows you to connect to a database file directly, without having to install an instance of the Full SQL Server, or SqlExpress.它允许您直接连接到数据库文件,而无需安装完整 SQL Server 或 SqlExpress 的实例。 It is fully compatible with the full version of SQL server.它与完整版的 SQL Server 完全兼容。 There are no installation requirements on the client end, as the libraries are packages along with your application when it is built.客户端没有安装要求,因为库在构建时与您的应用程序一起打包。
您可以通过这种方式在您的设置中以静默安装方式安装 sql express 不显示任何安装 sql express 的向导 阅读此链接
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.