简体   繁体   English

MS Visual Studio 2010中的本地数据库

[英]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. 我今天发现了该功能在VS 2010 C#中的存在,但实际上并没有发现很多关于Google的功能。 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)? 如何动态地向其中添加内容(我使用的是MySql,它本身不支持它,所以我必须访问数据并从代码中将其添加到Local Db中)?
  3. How to retrieve the content from it? 如何从中检索内容?

You could use LocalDb . 您可以使用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 . 为了向您的localDb添加/删除/检索内容,请查看Entity Framework

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. 如果您引用的是您可以在Visual Studio中创建的数据库的SQL Express实例,那么答案是数据将一直存储到删除为止(与任何其他数据库相同),并且在关闭创建的应用程序和关闭VS之前一直存在下。

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. 您可以将其视为可用于项目的门户网站数据库,直到准备好将其发布。 :) :)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Visual Studio 2010中创建和使用本地数据库 - Creating and utilizing a local database in Visual Studio 2010 MS Visual Studio 2010数据库与MS Access 2007的连接 - MS Visual Studio 2010 Database connection to MS Access 2007 如何在Visual Studio 2010中将数据保存到本地数据库? - How to save data to local database in visual studio 2010? 在Visual Studio 2010中连接到本地SQL数据库时访问被拒绝 - Access Denied While Connecting to local SQL database in Visual Studio 2010 Visual Studio 2010和创建本地数据库连接会导致注册表键错误 - Visual Studio 2010 and creating Local Database Connection causes error with regkey 使用MS Visual Studio 2015添加本地SQL数据库时出错 - Error to add local sql database with MS Visual Studio 2015 数据库中的协助检查值与在Visual Studio 2010中使用MS Access 2010在登录表单中输入的值 - Assistance checking values in a database vs values entered in a log in form in Visual Studio 2010 and using MS Access 2010 如何在未安装Office 2010的计算机上安装带有MS Access数据库的Visual Studio 2010安装项目? - How to install visual studio 2010 setup project with MS Access database on a computer which is not having Office 2010 installed? 在尝试使用C#连接到Visual Studio 2010中的本地SQL Server数据库时遇到问题 - Having problems trying to connect to local SQL Server database in Visual Studio 2010 using C# 使用Visual Studio 2012的本地数据库 - Local Database with Visual Studio 2012
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM