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

穿精又带淫゛_ 提交于 2019-11-26 21:11:19

问题


I am creating a window application that need to use sql server database. I want to install this application to client machine without installing sql server so that my application can still connect to a database i.e mdf file that i will be providing at client system.

How can i connect to a database(mdf) on client machine through my window application without installing sql server. ? 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. Every thing needs to be run through pen drive


回答1:


.mdf files are SQL Server database files. No other application can understand, read or update those files. If you need to open and mdf, you need a SQL instance. That instance can be local, can be an Express edition, or can be a remote one, doesn't matter. If your application needs a local SQL instance for it's own use then it can install SQL Server Express Edition when deployed.




回答2:


You can try Sql Compact Edition or SqlLite. I think these are just a file based solution.




回答3:


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. 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.

Regards..




回答4:


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.
You don't have any other way except to use another database like access.
This database doesn't need its software.



来源:https://stackoverflow.com/questions/2054905/connecting-to-sql-server-database-mdf-file-without-installing-sql-server-on-clie

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!