如何为包含SQL Server数据库的Windows应用程序创建安装程序 [英] How to create Installer for windows application containing sql server database
本文介绍了如何为包含SQL Server数据库的Windows应用程序创建安装程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何为包含SQL Server数据库的Windows应用程序创建安装程序
How to create Installer for windows application containing sql server database
<a href="http://www.dreamincode.net/forums/topic/58021-deploying-a-c%23-application-visual-studio-setup-project/">http://www.dreamincode.net/forums/topic/58021-deploying-a-c%23-application-visual-studio-setup-project/</a>[<a href="http://www.dreamincode.net/forums/topic/58021-deploying-a-c%23-application-visual-studio-setup-project/" target="_blank" title="New Window">^</a>]
but problem how to integrate sql server withnthe installer
推荐答案
^ ]
您好,
检查一下,
演练:使用自定义操作在安装时创建数据库 [ ^ ]
希望对您有所帮助.
Hi,
check this,
Walkthrough: Using a Custom Action to Create a Database at Installation [^]
hope it helps.
示例连接字符串
SqlConnection con =新的SqlConnection(数据源=.\\ SQLEXPRESS; AttachDbFilename = | DataDirectory | \\ sample.mdf; Integrated Security = True; User Instance = True");
SqlCommand cmd =新的SqlCommand();
sample connection string
SqlConnection con = new SqlConnection("Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\sample.mdf;Integrated Security=True;User Instance=True");
SqlCommand cmd = new SqlCommand();
这篇关于如何为包含SQL Server数据库的Windows应用程序创建安装程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文