如何在没有安装SQL Server的情况下将C#数据库应用程序运行到其他PC? [英] How to run C# databased application to other pc without SQL server installed?
问题描述
我的数据库应用程序在我创建项目的电脑上工作正常。现在我测试项目到另一台没有安装sql server的电脑。我的应用程序无法访问我的数据库[.mdf]中的记录。任何人都可以检查我的连接字符串是否正确。另外,我没有通过网络访问数据库..我只需要在没有安装sqlserver的情况下运行我的应用程序到其他电脑。
使用:
msvisual studio 2010和mssql server 2008 r2。
我尝试过: < br $>
my db application works fine in my pc where i created my project. Now i test the project to another pc without sql server installed. My application cant access the record in my database [.mdf]. Can anyone check my connection string if it is correct. In, addition, im not accessing the database through network.. all i need is to run my application to other pc without sqlserver installed.
using:
msvisual studio 2010 and mssql server 2008 r2.
What I have tried:
string str = @"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|rhu.mdf;Trusted_Connection=True;Connect Timeout=30;User Instance=True";
推荐答案
如果您需要它在没有安装SQL Server的情况下工作,请不要使用SQL Server。使用SQL Server Compact,SQLite,甚至推送Access,都可以在不需要在客户端上安装服务器应用程序的情况下使用它们。
If you need it to work without SQL Server installed then don't use SQL Server. Use SQL Server Compact, or SQLite, or even Access at a push, they can all be used without the need to install a server application on the client.
这篇关于如何在没有安装SQL Server的情况下将C#数据库应用程序运行到其他PC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!