简体   繁体   中英

Database in C# Programming

I am new to database in .NET Framework. I really wonder about the difference between Local database in Visual Studio and Database in Microsoft SQL Server. Could anyone explain me it? and when should we use it?

LocalDB is created specifically for developers. It is very easy to install and requires no management, yet it offers the same T-SQL language, programming surface and client-side providers as the regular SQL Server Express. In effect the developers that target SQL Server no longer have to install and manage a full instance of SQL Server Express on their laptops and other development machines. Moreover, if the simplicity (and limitations) of LocalDB fit the needs of the target application environment, developers can continue using it in production, as LocalDB makes a pretty good embedded database too.

Read: Introducing LocalDB, an improved SQL Express

Client-server, SQL Express

If you set up a database with SSMS and connect to it via SQL Express then you don't have a local database that's part of your project, you have a database for which the server happens to be local to your workstation.

Local database, SQL Express

If you set up a database with SSMS, dismount the database and add the file to your project, then you have a local database that uses a private instance of SQL Express.

Local database, Compact Edition

Actually you have three options. The option you didn't describe is the one where you create a database with SSMS and then set up a connection to a file and select the MDB file that was created by SSMS (you will probably need to first dismount the database using SSMS to get SQL Express to release its file locks). When you created this connection to a file, you will be prompted as to whether you want to connect to it where it is, or add it to your project.

A local database can take two forms, depending on how you create it. For detailed information, consult How to: Manage Local Data Files in Your Project.

Client-server, SQL Express

If you set up a database with SSMS and connect to it via SQL Express then you don't have a local database that's part of your project, you have a database for which the server happens to be local to your workstation.

Local database, SQL Express

If you set up a database with SSMS, dismount the database and add the file to your project, then you have a local database that uses a private instance of SQL Express.

Local database, Compact Edition

If you create a new database with the Visual Studio menus, you have a local Compact Edition database .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM