📜 ⬆️ ⬇️

Support for new embedded database in ASP.NET

sql ce 4 Just the other day, I talked about the new IIS Express and talked about our work on the improvements that we made to make ASP.NET developers easier.

And today's post will continue the topic of simplifying development and will reveal information about our developments in the field of databases. In fact, I want to announce the completion of our work on free SQL Server Compact Edition (SQL CE) in ASP.NET applications. This allows you to simplify the development of the database.


SQL Server Compact Edition 4


SQL CE is completely free, built-in database engine. We will provide access to the first public beta very soon. Version 4 was developed and tested with a focus on working with ASP.NET web applications.
')

Work with existing APIs


SQL CE works with existing .NET APIs and supports SQL Server compatible query syntax. That means with SQL CE. you can use existing APIs for working with data such as ADO.NET, as well as higher-level ORMs like the Entity Framework and NHibernate. Almost any existing data API that supports the ADO.NET provider model will work.

All this allows you to use well-established programming skills when working with data today.

Does not require any installation


In order to use SQL CE, you do not need to start the installation or install the database server. Now you simply copy the SQL CE executable files to the \ bin folder of your ASP.NET application, and then your web application can use it as a database engine. No installation or additional security rights are required, just launched and running.

Applications are free to include in the SQL CE package. You simply copy the web application to any server and it works.

Database files are stored on disk.


SQL CE stores databases as files (with a .sdf extension). You can store these files in the project directory \ App_Data, there is no need to register them for use in the application.

The SQL CE engine runs in the memory of your ASP.NET application. When the application completes its work, it is automatically unloaded.

Shared hosting already supports SQL CE 4


SQL CE 4 can already work on ASP.NET 4 hosting with an average level of trust in applications, the hoster does not need to install anything. Hosters do not need to do anything to run SQL CE.

Now you can generally deploy the application using one FTP, just copy the project folder and everything is ready.

SQL CE will start itself in your application on a remote host.

Support for Visual Studio 2010 and Visual Web Developer 2010 Express


In the near future, VS 2010 and Visual Web Developer 2010 Express will have tools that support working with SQL CE 4. You can add SQL CE files to ASP.NET projects, use Visual Studio Server Explorer to create and edit tables, and use high-level designers. like the Entity Framework (see below) for modeling and binding the database to classes that will later be used in LINQ.

image

In addition to the data API you already know, you can use the same development tools for SQL CE.

Development and Production


SQL can be used, on the development machine, and for simple production sites. From the 4th version of SQL CE, we carried out the technical work and made sure that the SQL CE will not fall or interlock when multi-threaded scripts occur, as is the case with ASP.NET. This is a huge change compared to the previous version of SQL CE, which we developed only for the client side, plus - it blocked the work in the web environment. And now SQL CE 4 can be used on web servers without any problems.

There are no licensing restrictions for using SQL CE.

Simple Migration to SQL Server


SQL CE is an embedded database, which makes it ideal for simple scripts. For high-load sites and applications, you probably want to migrate to SQL Server Express (free), SQL Server or SQL Azure. Server data has better scalability, more development capabilities (including features such as stored procedures that are not supported in SQL CE), as well as more advanced data management capabilities.

We will provide migration tools that will take the SQL CE database and easily upgrade to SQL Server Express, SQL Server or SQL Azure. You do not have to make changes to the code to upgrade the SQL CE database to SQL Server or SQL Azure. Our goal is to give you the opportunity to simply change the connection string to the database in web.config and continue working with the application.

findings


SQL CE 4 provides a simple, lightweight database that you can use in an ASP.NET application. Allows you to quickly start working on a project without requiring the installation of a full-fledged database on the local developer’s machine Due to compatibility with the full version of SQL Server, your code uses all the same APIs (ADO.NET, Entity Framework, NHibernate, etc.)

You will be able to quickly deploy SQL CE database on hosting for simple sites and applications. In the future, with the growth of traffic and load, you can upgrade the database to SQL Server Express, SQL Server or SQL Azure, without changing the code.

We will provide access to the first public beta version of SQL CE 4 (along with IIS Express and other cooler things, I'll write more about) next week.

Source: https://habr.com/ru/post/98051/


All Articles