Embedding a SQL localdb database in C#.Net

2019-05-19 23:39发布

问题:

I want to create an application and for that I need to have a database. By searching Google I came to know that for my purpose SQL localdb will be good as it is light and fast. Kindly tell me the procedure for embedding this database in my program. I want to create a desktop application which can run on any Windows machine.

回答1:

Sql CE may be a good fit. Scott Guthrie posted about implementing this - http://weblogs.asp.net/scottgu/archive/2011/01/11/vs-2010-sp1-and-sql-ce.aspx



回答2:

you can use Siaqodb,it is a C# written db and it is designed for embedded envs - http://siaqodb.com



回答3:

I maintain a C# wrapper to the SQL LocalDB API in GitHub which is also available in NuGet. It will allow you to manage instances of SQL LocalDB in your application.



回答4:

I've had success using SQL Express in that way.

The most widely deployed database like you describe is SQLite. I would check that out as well.

SQLite HERE

Using a C# wrapper HERE

Or a C# port of SQLite HERE