Although this article of mine is not about ASP.NET, but it gives you an overview of connecting to SQL Server using C#.
How to connect SQL Database to your C# program, beginner's tutorial[
^]. You should consider learning a few concepts for
SqlClient
[
^] namespace first, generally, it is this class that is used to connect to and execute commands on SQL Server.
SqlConnection
,
SqlCommand
,
SqlParameter
and many more are
objects declared in this namespace.
Chances are that you will be able to write your own connectors to connect to SQL Server and execute your own statements. In ASP.NET, Entity Framework is a good framework to work with SQL Server, EF allows you to focus on your logic and abstract the data manipulation layer and leave it to .NET framework. Read
Solution 1 by Mika for that.
Edit
Since you are developing the application, it is good to use localDb rather than purchasing a SQL Server license and installing an entire server to run it. You should understand that even running SQL Server Express requires you to install the server, without it, your database won't work. LocalDB is a very compact edition (
just as a personal tip, I think that SQL Server CE was upgraded to SQL Server LocalDB, because Microsoft is no longer publishing SQL Server CE officially), and LocalDB comes shipped with a few required files and assemblies (just similar to SQL Server CE) which are needed to run your database.
Then, on the hosting environment you can create a database there. IMO, it is better to create a new copy of database on their server rather than deploying your database files there. Many problems of authentication and similar raise when you try to deploy your application on server.
For these reasons, I would suggest that you continue programming and development with LocalDB, and when your web application gets deployed on hosting environment, you should run a script to generate a database file based on the environment. :-)
For more on LocalDB,
read this[
^]. I enjoy SQL Server LocalDB, after Microsoft stopped support for SQL Server CE. They save a lot of time and I don't even have to run any background server to get the data.
You should also note that hosting providers usually do not support LocalDB, they provide you with a licensed copy of either SQL Server 2008-2014.
How would I upload the database? As I said, you should not. You are not sure of what assemblies you will be provided on hosting environment. For this sake, I said create a new database on the server end when you upload your files there. Do that manually or by script.
As Mika has mentioned, LocalDB is not intended for commercial use you would require to get a copy of SQL Server, but a better choice is to search for a copy of
SQL Server on the hosting server.
Other features, such as advertising, payment processing is a totally different thing to talk about. :-)