tony.hegyes
tony.hegyes

Reputation: 265

Local database in MS Visual Studio 2010

I found out today about the existance of this feature in VS 2010 C# and I didn't really find out pretty much googling it. Actually, I have the following questions:

  1. If I use one of these and load it with data once, will the data be erased when I close the application or will it stay there until I delete it?
  2. How to add content to it dynamically (I am using MySql and it doesn't have support for it natively, so I have to acces the data and add it in the Local Db from within the code)?
  3. How to retrieve the content from it?

Upvotes: 0

Views: 3629

Answers (2)

Steven Muhr
Steven Muhr

Reputation: 3369

You could use LocalDb.
Your data won't be erased when you close your application.

In order to add/delete/retrieve content to your localDb, have a look to Entity Framework.

Upvotes: 2

Stephen
Stephen

Reputation: 1737

If you are refering to the SQL Express instance of a database you can create in Visual Studio, then the answer is the data is stored until you delete it (same as any other database) and persists across closing the application you create and VS being closed down.

You can think of it as a portalable database that you can take with your project until it's ready to be released into the wild. :)

Upvotes: 2

Related Questions