简体   繁体   English

连接到sql server数据库mdf文件而不在客户机上安装sql server?

[英]Connecting to sql server database mdf file without installing sql server on client machine?

I am creating a window application that need to use sql server database. 我正在创建一个需要使用sql server数据库的窗口应用程序。 I want to install this application to client machine without installing sql server so that my application can still connect to a database ie mdf file that i will be providing at client system. 我想将此应用程序安装到客户端计算机而不安装sql server,以便我的应用程序仍然可以连接到数据库,即我将在客户端系统提供的mdf文件。

How can i connect to a database(mdf) on client machine through my window application without installing sql server. 如何在不安装sql server的情况下通过我的窗口应用程序连接到客户端计算机上的数据库(mdf)。 ? I dont know is it possible or not. 我不知道是否有可能。

If possible what will be the connection string in that case. 如果可能的话,那种情况下的连接字符串是什么。 Database need not be used in network. 数据库不需要在网络中使用。

Client mahine dont need any installation. 客户端mahine不需要任何安装。 Every thing needs to be run through pen drive 每件事都需要通过笔式驱动

.mdf files are SQL Server database files. .mdf文件是SQL Server数据库文件。 No other application can understand, read or update those files. 没有其他应用程序可以理解,读取或更新这些文件。 If you need to open and mdf, you need a SQL instance. 如果需要打开和mdf,则需要一个SQL实例。 That instance can be local, can be an Express edition, or can be a remote one, doesn't matter. 该实例可以是本地的,可以是Express版本,也可以是远程版本,无关紧要。 If your application needs a local SQL instance for it's own use then it can install SQL Server Express Edition when deployed. 如果您的应用程序需要一个本地SQL实例供自己使用,那么它可以在部署时安装SQL Server Express Edition。

You can try Sql Compact Edition or SqlLite. 您可以尝试Sql Compact Edition或SqlLite。 I think these are just a file based solution. 我认为这些只是一个基于文件的解决方案。

In that case you must have a server machine where your database files are stored. 在这种情况下,您必须具有存储数据库文件的服务器计算机。 For that reason you have to use SQL Express Edition 2005 or 2008 in one machine and SQL server management studio to manage your database. 因此,您必须在一台计算机和SQL Server管理工作室中使用SQL Express Edition 2005或2008来管理数据库。 Those are all free from Microsoft. 这些都是免费的。 The client machines will be connected through the connection string. 客户端计算机将通过连接字符串连接。 Those machines don't need SQL instance or SQL server installed. 这些机器不需要安装SQL实例或SQL服务器。

Regards.. 问候..

You can search your MS-VS CD for SQLEXPRESS (please note the capital letters) and include it in your software when you create the set-up and your problem will be solved. 您可以在MS-VS CD中搜索SQLEXPRESS(请注意大写字母),并在创建设置时将其包含在软件中,您的问题将得到解决。
You don't have any other way except to use another database like access. 除了使用其他数据库(如访问权限)之外,您没有任何其他方式。
This database doesn't need its software. 该数据库不需要其软件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM