Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there any classes that can be queried / modified like a DB but is entirely local and internal to the program?

Are there any classes that can be queried / modified like a SQL DB but is entirely local and internal to the program?

I am aiming to write a program that needs to have a local data source with all data saved in a file, but I would like to be able to query this information store just as I would a DB; LINQ compatibility would be a huge plus.

The data would only be accessible when the program was running meaning, there would be no other process running to serve the data such as SQL server.

like image 407
Matt Avatar asked Mar 01 '10 06:03

Matt


People also ask

How do I know if my database is updated?

You can use $stmt->rowCount() to find out if any rows were updated. It will be 0 if no rows were found, otherwise it will be non-zero.

How do I link a database to a website in Visual Studio?

Connect using SQL Server Object ExplorerTo access the connect dialog from SQL Server Object Explorer, click the toolbar button Add SQL Server. The connect dialog comes up. Choose your local, network, or Azure SQL server, select a database, provide credentials, and choose Connect.


2 Answers

You could use SQLite with DBLinq.

like image 21
Mark Byers Avatar answered Oct 06 '22 23:10

Mark Byers


You can use SQL Server Compact Edition. It is hosted in-process and uses a .sdf file locally. It works with LINQ and the LINQ-to-SQL designer. To use it, you'll just need to add a reference to System.Data.SqlServerCe.dll. It's very lightweight, familiar, and has excellent support in Visual Studio.

On a side note, the Visual C++ IDE team is using this database for their C++ IntelliSense information in Visual Studio 2010, replacing the old .ncb files. Based on their stated goals going into the project (rewriting the C++ IDE for massively improved IntelliSense performance and stability), seeing it used here says a lot.

like image 186
Sam Harwell Avatar answered Oct 07 '22 01:10

Sam Harwell