Migrating from a local database to SQL Server hosted on a server

So, I'm pretty new to MVC and C # in Visual Studio. I recently finished a tutorial located at:

http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/implementing-basic-crud-functionality-with-the-entity-framework-in-asp-net-mvc- application

It was fun and educated in some aspects. I have one question, although about the database to which it connects, in the tutorial it creates a local SQL Server database, and CRUD then works with this. I currently have an external SQL Server database hosted on a server that I would like to be able to play with, I successfully connected to it through Visual Studio (2012), but I was wondering how difficult it is to pass CRUD to it.

After a little reading, I changed the connection string and added:

using System.Data.SqlClient

But I still use:

using System.Data.Entity

Not sure if I need both and I use EF (Entity Framework).

Can someone tell me what other steps need to be completed in order to successfully pass this? Or in what direction should I look, because tbh I am not a database or SQL (or MVC) expert, and this is a bit confusing.

Any links, links or tutorials are welcome.

+5
source share
3 answers

, . . - , , , , . Web Deploy. , . . " ". "" / " SQL". , . , .

Web publishing toolbar

Great Web Deploy Explanation

+1

.sqlproj LocadDB, SQL Server. MVC, . , .

+1

I worked with web forms, but I believe that this is the same thing that you will need to edit the Connection line in the web.config file in your solution to point to the hosted database in order to play with it.

SQL Server:

Data Source={SERVER NAME};Initial Catalog={DataBaseName};User Id={SQLUsername};Password={SQLPassword};

MySQL:

Server={SERVER NAME};Database={DataBaseName};Uid={SQLUsername};Pwd={SQLPassword};

Let me know if this helps.

0
source

All Articles