如何给忽略了最低具有SQL Server安装在计算机上运行与SQL数据库应用 [英] How to run Application with SQL Database on a machine that dosen't have SQL Server Installed

查看:149
本文介绍了如何给忽略了最低具有SQL Server安装在计算机上运行与SQL数据库应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开发了具有显示从
SQL数据库的一些数据的滑块的应用程序。我使用Visual Studio 2010和Microsoft SQL Server 2008中。

I have developed an application that have a slider that showing some data from a SQL Database. I'm using Visual Studio 2010 and Microsoft SQL Server 2008.

在事实上,当我部署我不面对我的应用程序的任何一个问题来看,它在我的个人电脑。当我尝试另一台机器上
中的问题时,问题是应用程序无法连接的SQL数据库。我试图找出问题的原因,所以它的两台机器上部署后,我试了一下,他们中的一个上安装了一个SQL服务器,而另一个没有在SQL Server。
中的应用工作完美具有安装在其上的SQL服务器的机器上,并且它不能被连接到其他机器上的数据库。

In fact i don't face any problem with my application when i deploy it an run it on my Personal Computer. The problem occurs when i try it on another machine, and the problem is that the application couldn't be connected the SQL database. I tried to figure out the reason of the problem, so i tried it after its deployment on two machines, one of them have a SQL server installed on it, and the other one don't have the SQL Server. The Application worked perfectly on the machine that have the SQL Server installed on it, and it couldn't be connected to the database on the other machine.

这是连接字符串我在我的应用程序中使用>>

This is the Connection String i have used in my application>>

的connectionString =数据
来源= .\SQLEXPRESS; AttachDbFilename = | DataDirectory目录| \KBank.mdf;集成
安全=真;用户实例=真

connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\KBank.mdf;Integrated Security=True;User Instance=True"

因此,如果还有一种方法,可以让我跑,而不需要机器安装了SQL Server的应用程序,我将不胜感激。谢谢

so if there is a way that could enable me to run the application without needing the machine to have a SQL Server installed, i would be grateful. Thanks

推荐答案

您需要更改连接字符串指定数据库安装在计算机上。类似如下:

You need to change the connection string to specify the computer the database is installed on. Something like the following:

的connectionString =数据源= machine\SQLEXPRESS; AttachDbFilename = | DataDirectory目录| \KBank.mdf;集成安全=真;用户实例=真

connectionString="Data Source=machine\SQLEXPRESS;AttachDbFilename=|DataDirectory|\KBank.mdf;Integrated Security=True;User Instance=True"

请注意:需要在另一台机器上的数据库进行适当配置,因此它可以从其他机器访问。

Please note: The database on the other machine needs to be configured properly so it can be accessed from other machines.

这篇关于如何给忽略了最低具有SQL Server安装在计算机上运行与SQL数据库应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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