如何在vs 2010中的c#windows应用程序中启用sql数据库启用设置 [英] How to make sql database enabled setup in c# windows application in vs 2010
问题描述
我已经为客户完成了库存系统。在它的连接字符串中,我使用的是我的计算机/服务器名称,如
数据源= arvind-PC\arvind
初始目录=库存
集成安全性= true
安装程序在我的计算机上正常工作,但无法在客户端计算机上运行。
客户端计算机的连接字符串是否还有其他进程。我正在使用VS 2010,SQL Server 2008 R2,Windows 7.请帮助我
我尝试过:
我的计算机/服务器名称如
Data Source = arvind-PC\arvind; Initial Catalog = INVENTORY; Integrated Security = true
arvind-PC是我的电脑名。
如果你试图在客户端应用程序中获取数据库表的数据,那么SQL服务器或客户端安装的SQL Server版本才能使用.mdb文件访问数据。
- 或 -
使用客户端 - 服务器基础结构,客户端可以通过LAN连接到SQL服务器。在这种情况下,服务器名称将采用System_IP / DB_Name格式。
在客户端应用程序中,连接字符串应如下所示
< pre lang =c#> string constr = 数据Source =< server_name> ;; Initial Catalog =< db_name> ;; User Id =< login_name> ;; Password =< password>;
如果使用Windows身份验证代替用户ID和密码配置SQL服务器,请使用Integrated Security = true ;
I have completed an inventory system for a client. In it's connection string I am using my computer/server name like
Data Source=arvind-PC\arvind
Initial Catalog=INVENTORY
Integrated Security=true
Installer is working properly on my computer but not working on client computer.
Is there any other process for connection string for client computer. I am using VS 2010, SQL Server 2008 R2, windows 7. Please help me
What I have tried:
my computer/server name like
Data Source=arvind-PC\arvind;Initial Catalog=INVENTORY;Integrated Security=true
arvind-PC is my computer name.
If you are trying to get your DB table's data in client application then the SQL server or a client installed SQL server edition is required to install on client's system to access data using .mdb file.
--or--
Use a client-server infrastructure where client can connect to your SQL server via LAN. In this case server name would be in "System_IP/DB_Name" format.
And in client application connection string should be as below
string constr="Data Source=<server_name>; Initial Catalog=<db_name>; User Id=<login_name>; Password=<password>";
And if SQL server is configured using windows authentication in place of User Id and Password useIntegrated Security=true;
这篇关于如何在vs 2010中的c#windows应用程序中启用sql数据库启用设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!