using SQL Server Compact Edition in ASP.NET websites - asp.net

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

Related

Hosting ASP.NET application with SQL Server DB

I have a web site developed in ASP.NET MVC and used MS SQL Server as a back-end database.
I was trying to host this application on webFaction, but unable do do so as it seems WebFaction does not support hosting of ASP.NET applications.
Can I host ASP.NET application with SQL Server as DB on WebFaction?
The official answer is here: https://community.webfaction.com/questions/17081/asp-as-application/17099
WebFaction only offers Linux server hosting.
If you want to use ASP.Net, you'll have to use Mono. They don't provide an installer for it, so you'll need to build the Mono stack from scratch.
Per MS SQL server, it doesn't (currently) run on Linux. So you will either need to connect your Webfaction ASP app to another hosting service for the database, switch to a new database, or wait for MS to release their linux version of MS SQL.

Publish ASP.NET MVC 4 (Razor) app onto remote server running Windows 7 with IIS 7

I have experience in hosting an Asp mvc 4 application on local IIS with Sql server as back end. Now I want to host this application on another system that don't have Sql server and Visual studio installed. I think we can able to get all files necessary to host by publish option in visual studio 2012. But I don't have any idea on how to make my database working on the server without sql server and the necessary connection strings. Can I change my db to sql server compact 4.0?
Please give the necessary instructions.
For .net Application you can generate necessary files using publish feature of VS.You can even make use of web-deploy for direct deployment of artifacts to remote server itself.
For db you better have sql -engine, without that it get's tricky. Express edition will always be better option if you are not looking for some advanced DBA jobs.

SQL Server Express and SQL Server Compact Edition

I've just built my first Umbraco site and now I want to hand it over for deployment on a web server. However, I built the site on my local machine using Web Matrix, which uses a SQL Server Compact Edition database, which is represented in a .sdf file.
I was a bit uneasy about whether this would be much use to the person I'm passing the site to (they have a number of Umbraco based sites running on this server using SQL Server) - so I installed SQL Server Express and migrated the database from Compact Edition to Express. However (again), I can't seem to find any way of exporting the full database to a file which can then by imported into a database on the web server.
A couple of points I guess - first, is the Compact Edition .sdf file actually enough for someone to take and import a database into SQL Server Standard? Failing that, how would I export the database from SQL Server Express to a file which could be used for this purpose?
Thanks in advance - this is my first foray into .net development so I'm grateful for any help!
You could just give the SQL CE database (.sdf) to the person who manages the web server. The SQL CE database can be run by default on a .NET webserver.
If, for some reason, you want to migrate it to SQL Server, you can do this through Web Matrix (http://www.microsoft.com/web/)
When you have already converted the SQL CE database to SQL Server, you can:
make a backup through the SQL Server Management Studio tool and restore the backup on the web server
or you can use the SQL Server Management Studio tool to script the database to a .sql file which can be executed on the web server
I prefer the first option.

How sync sql server 2008-R2 (remopte server with local) using Microsoft Sync Framework

How can i sync sql server 2008-R2 (remopte server and local) using Microsoft Sync Framework?
there are tons of documentations about that framework, but i could n't find a step-by-step guide for synchronization.
i downloaded Sync Framework 2.1 SDK From here
just a framework and after installation there are some dlls in program files folder.
now what should i do and which Tools should i use?
where can i downlaod those tools?
i saw a tool (PUTTY.exe) in one of servers that i have access. what is this tool and is it in relationship with sync framework?
i have two databases(sql server 2008 - R2) : A in Local And B in a Web server.
both of these databases are the same and i just want to sync their data with a scheduled program.
thanks in advance
the documentation includes a walkthrough/tutorial, see:
Tutorial: Synchronizing SQL Server and SQL Express
this should work with SQL Server to SQL Sever as well and you should find the same in the documentation that gets installed with the SDK.
here's a sample using WCF:
Database Sync:SQL Server and SQL Express N-Tier with WCF

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