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

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.

Related

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.

Running asp.NET application on a local computer for testing purposes

I developed a web application for some small company. It connects to an SQL database created in Microsoft SQL server Managment studio 2008. Now they would like to test this app on a local computer before they put it on a server.
My question is, what are all the things I need to make this app work on a random computer running Win with no Visual Studio or SQL server installed?
Thanks for your help.
EDIT: They want to run it on a local computer only.
maybe Microsoft Web Platform Installer 3.0 can help you out.
http://www.microsoft.com/web/downloads/platform.aspx
Install .Net version you are using. It might already be there.
Install/configure IIS
Install SQL Server Express
Your db connection string obviously need to be changed to the local
sql server connection in web.config
Because it is a simple app, just copy the entire app (except proj
files, .cs, .vb files) to that computer
For one, point the connection string at SQL Server on a staging server. The whole idea of testing is to have the same environment as the production server.

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

How to deploy an ASP.net C# on windows2008 server

I want to deploy a Website which i have created using Microsoft Visual Studio 2008 Express Edition onto a remote server having Microsoft Windows Server 2008.
I don't know anything about deployment. I want to know what are the things required on the Server in order to make the website work for all the client machines.
i had used ajax toolkit, VisualStudio2008 Express Edition and mysql on my developer machine.
One method which i tried is using copy website,it dint work,may be because i don't know the proper way to do it.
Please help me to deploy my ASP.net website.
The first step to setup your website on Windows Server 2008. Is to setup IIS. Installing IIS7 on Windows Server 2008.
Once that's completed, setup your SQL server on either that machine or a different one.
Depending on your setup. Copy your website files to your web site directory. By default it's [Drive]:\inetpub\wwwroot. You can change the target by virtual directories.
One note, you will need to install AJAX on your server for it to run correctly.

Coding for an SQL server in a local project

I'm coding in ASP.Net on a local machine through visual studio. So when I run the code it starts an ASP.Net service for me.
So now I'm wondering how I setup an SQL server for local development purposes? I need it to have data in it constantly so that when I stop running the ASP page it doesn't just empty.
You should be able to install SQL Express and hook into that. The data will persist in the db unrelated to your asp.net service:
http://msdn.microsoft.com/en-us/library/ms247257%28VS.80%29.aspx

Resources