Developing with SQL Server Express and delpoiyng with SQL Server 2008? - asp.net

I'am developing a web application with VS2010 Entity Framework and SQL Server Express.
This application will be deploiyed in a server with SQL Server 2008 (not express)
It is possible?
What changes (if needed) i need to do?

This is possible.
You just need to change your connectionstring to point to the new database.
SQL Express has some limitations to do with performance and scalability (SQL Server Express supports 1 physical processor, 1 GB memory, and 4 GB storage(10GB in 2010 version)) but none in terms of how you utilise it in your app.

Whatever you develop in SQL Express should work (See #geoff's recommendation). If you need features in SQLServer 2008 that are not available in express, you won't be able to test them.

Related

Why do we use mostly LocalDB instead of SQL Server?

I am confused between localDB and SQL Server. What is actual difference between using LocalDB and SQL Server? And, which one is recommended?
LocalDB is a lightweight version of the SQL Server Express Database Engine that is targeted for program development. LocalDB starts on demand and runs in user mode, so there is no complex configuration or installation of a full blown DB engine.
From Introducing LocalDB, an improved SQL Express:
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.

using SQL Server Compact Edition in ASP.NET websites

I know next to nothing about databases, but need to store and present user input on my ASP.NET tiny website (up to several thousand records). Should I consider SQL Server Compact Edition? In Microsoft docs I found:
SQL Server Compact 3.5 is not currently optimized to serve as a database for Web sites. By default, connections from ASP.NET-connected applications are blocked in SQL Server Compact 3.5. SQL Server Compact 3.5 is optimized for use as an embedded database within applications. Using SQL Server Compact 3.5 as a database for Web sites requires support for multiple users and concurrent data changes. This can cause performance problems. Therefore, these scenarios are not supported. Other editions of SQL Server, including SQL Server 2005 Express Edition and later versions, are optimized to serve as a database for Web sites.
But then I remember reading some user comment that the 4.0 version of SQL Server CE is finally working OK in ASP.NET scenario. Anyone care to share his experience? I would like to try CE first as SQL server requires additional fee on my hosting.
From the download site for SQL Server Compact 4.0:
Microsoft SQL Server Compact 4.0 is a free, embedded database that software developers can use for building ASP.NET websites and Windows desktop applications.
And:
SQL Server Compact 4.0 enables new scenarios and includes a host of new features, including the following:
SQL Server Compact 4.0 is the default database for Microsoft WebMatrix, which is a stack of web technologies for easily building and deploying websites on the Windows platform.
(emphasis mine)
In conclusion - it has specifically been enhanced for web scenarios.
Yes, SQL Server Compact 4.0 has been designed with scenarios similiar to yours in mind.
New Embedded Database Support with ASP.NET
SQL CE is a free, embedded, database engine that enables easy database storage.
No Database Installation Required
SQL CE does not require you to run a setup or install a database
server in order to use it. You can simply copy the SQL CE binaries
into the \bin directory of your ASP.NET application, and then your web
application can use it as a database engine. No setup or extra
security permissions are required for it to run. You do not need to
have an administrator account on the machine. Just copy your web
application onto any server and it will work. This is true even of
medium-trust applications running in a web hosting environment.
SQL CE runs in-memory within your ASP.NET application and will
start-up when you first access a SQL CE database, and will
automatically shutdown when your application is unloaded. SQL CE
databases are stored as files that live within the \App_Data folder of
your ASP.NET Applications.
Visual Studio 2010 SP1 includes new tooling support for SQL CE

Developing with SQL Server 2005 and deploying to SQL Server 2000

I'm currently developing a web application using SQL Server 2005, ASP.Net MVC, ASP.Net SQL Membership Provider (for authentication and authorisation), and Linq to SQL. Everything works great and is running as planned in the development environment.
However, the production environment has a SQL Server 2000 installation, and we are unable to obtain a copy of SQL Server 2000 to use in development.
Upon deploying the web application to the the production environment, what options do I have for migrating the database (schema + data) from 2005 to 2000?
You should make sure that your database compatibility in your development system is set to SQL Server 2000, and then consider using a tool such as the Redgate toolbelt for scripting out your schema and data for deployment.
Well, you could use the Database Publishing Wizard to generate a script of your database to SQL 2000 format.

What's the difference between the database inside App_Data folder vs connecting to SQL Server?

I'm new to .NET and while starting to learn ASP .NET MVC2 framework I see that you can create a .mdf file inside the App_Data folder and connect to it or you can connect to a SQL Server.
What is the difference between these to methods of interacting with a database? What are the advantages/disadvantages of one over the other?
The "MDF in the App_Data" folder works for web site and web apps, and it works only with SQL Server Express (2005, 2008, 2008 R2). This is the version that's typically installed along with Visual Studio, and which works fine as a dev environment.
SQL Server Express has a few limitations on
number of CPU used (1)
max. size of a database (4 GB for 2005/2008, 10 GB for 2008 R2)
max. amount of RAM used (max. 1 GB)
and more. It's a great and free way to get into SQL Server development.
If you need production level SQL Server, then you're probably going to use a full version - Web, Workgroup, Standard, Enterprise or any of the highest level DataCenter editions.
There's a pretty comprehensive Compare SQL Server 2008 R2 Editions page up at Microsoft - go check it out!
The programming experience should be identical, too - it's really just a question of the ADO.NET connection string (and whether or not you need to have a locally installed SQL Server Express instance present).
The database file format is totally identical, so you can absolutely start with a .mdf file in your App_Data folder, and later move "up" to a full edition of SQL Server - simply attach your MDF file to your server instance, and now use that database. Works seamlessly.

How do I create my first database for .NET development?

Ok! I'm ready to embark on some .NET development for the first time.
I've recently installed Microsoft Visual Studio which included Microsoft SQL Sever 2005.
What is the prefered method for programming against a development database? I want to write an ASP.NET application that uses a database and I'm not sure how to create one. In my start menu for SQL Server 2005 all I have is:
SQL Server Configuration Manager
SQL Server Error and Usage Reports
SQL Server Surface Area Config
I don't see an intuitive program to create and design databases on that list, so how do I do it?! Will I be creating a full fledged SQL Server database or a "flat-file" fake database to program against?
Can someone please tell me what is up on creating my first MS SQL Server 2005 database?
If you've Visual Studio, just goto server explorer, Add a new database connection to your database, and start off.
Or, create a new website project in Visual studio, right click the App_Data folder->Add New Item and add a SQL Server database mdf file, which will be attached to the sql server when you run the app. You need to deploy the mdf file when doing a production release :)
You might want to watch the videos in ASP.NET website http://www.asp.net/learn/
Otherwise, consider using Microsoft SQL Server Management Studio (an express edition is also available).
You are looking for Microsoft SQL Server Management Studio Express. Its pretty easy to add a database once you get your head around it.
To be clear, the SQL Server included with Visual Studio is an express edition. However, the one thing it is lacking is the SQL Server Management Studio (Express). I'd download and install the express edition that included the management studio (note that VS 2005 and 2008 include SQL Express 2005, you can use either SQL Express 2005 or 2008 for your purposes).
You can create a new database and do everything you need to from within the VS IDE but you'll probably find the SQL Management Studio environment much more intuitive and simpler to use as a beginner.
A quick note on SQL Express - Microsoft doesn't suggest it for 'production' environments due to limitations placed on the amount of RAM that Express can see/use and a few other factors. This is one of the few cases in which I agree - if you're doing anything complex that involves large databases or dozens of users then invest in MSSQL Workgroup Edition at least, or for Enterprise projects use MSSQL Standard or Enterprise versions.

Resources