使用SQL Server 2008数据库部署Windows应用程序 [英] Deploying windows application with SQL server 2008 database

查看:124
本文介绍了使用SQL Server 2008数据库部署Windows应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Windows应用程序和ms sql server数据库。我想使用单个.exe文件将应用程序与数据库一起部署到客户端。我该怎么做?

如果我使用clickonce方法在部署application时应该是什么连接字符串。我要确定要提到的连接字符串。是否有其他方法可以使用数据库部署Windows应用程序。



我尝试了什么:



I have a windows application and ms sql server database with it.I want to deploy the application along with the database to client using single .exe file.How will I do it ??
If I use clickonce method what should be connection string when I deploy the application.how do I determine what connection string to mentioned.Is there any other method for deploying windows application with database.

What I have tried:

I have tried clickonce method but connection to database doesnot work.I think the issue is with connection string.I am using the below connection string which I use on my development machine.<pre lang="c#"><add name="Constr" connectionString="Data Source=.;AttachDbFilename=D:\SApplication\Database1.mdf;Integrated Security=True" providerName="System.Data.SqlClient" /></pre>

推荐答案

您的连接问题是因为您的连接字符串适用于您的机器,而不是您的客户。他可能甚至没有D盘。您的应用应具有数据库所在的特定应用程序子文件夹,然后您需要根据应用程序的安装位置构建连接字符串。
Your connection problem is because your connection string is for YOUR machine, not your customer's. He probably doesn't even have a D drive. Your app should have a specific application subfolder in which the database resides, and then you need to build your connection string according to the installed location for the app.


这篇关于使用SQL Server 2008数据库部署Windows应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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