开发者

Run a C# .NET Winform application, which uses SQL Server as database by only placing the .mdf files on the user PC

I have a C# .NET Winform application, which uses SQL Server as database. I want to run the application without in开发者_如何学编程stalling SQL Server on the destination PC, but only placing the .mdf files on the user PC. The mdf file would be stored locally on the PC on which the application would be executed.

How do I do this? What would be the connection string? Also, I have used SqlConnection , SqlDataReader objects, will they have to be removed?


If you want a standalone database for your application, you should have a look at

  • SQL Server Compact : http://www.microsoft.com/sqlserver/2008/en/us/compact.aspx
  • SQLite : http://sqlite.phxsoftware.com/


Sorry, you'd have to implement (most) of SQL Server's functionality yourself and also make it compatible with the mdf format... Not feasible.

As an alternative, use SQL Server Compact Edition.


As others say - you'll need some kind of SQL Server engine installed. If you only want read-only access, it's technically possible using OrcaMDF as an embedded MDF reader: https://github.com/improvedk/OrcaMDF

Disclaimer: I'm the author of OrcaMDF

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜