0

Visual Studio 2010 - C# - MVC3

I am completely new to ASP.Net and I have been working / practising making an MVC 3 application using C#. I have practised getting an MVC application online which makes use of no databases and was successful. My hosting supports .net 4 and it was a simple process of publishing the files and uploading to my FTP. I am making a new application which makes use of a database. I have set up a data connection in the server explorer and set up all my tables and relationships. Everything is currently working as intended and I can create, edit and delete entries from the database.

I am not really sure where to start with getting this online. My hosting offers no MSSQL databases so I am presuming I can use a MYSQL database? What is the process of changing my application to use a MYSQL database which is located on my remote hosting? Also I am making use of the default accounts where users can register and login, will I have to set up a database for this too?

Jpin
  • 1,527
  • 5
  • 18
  • 27

3 Answers3

1

Your host offers mysql hosting? you will need the mysql .net connectors.

also check this next out for the asp.net membership, mvc uses

http://dev.mysql.com/doc/refman/5.1/en/connector-net-tutorials-asp-roles.html

BBQ
  • 618
  • 1
  • 7
  • 20
0

You can use a local DB in your APP_DATA folder or you can connect to a remote DB. Please let me know if you need additional help in either of these two areas or if I have misunderstood your question. You may also want to encrypt your web.config file to secure your DB passwords better.

From our chat:

Try this stackoverflow.com/questions/…

user1477388
  • 20,790
  • 32
  • 144
  • 264
  • well ideally I would like to use a local db (meaning stored on my hosting?). Would I still be able to update that as normal say through an admin panel where the admin can add and edit entries? This is ideally what I want to do – Jpin Sep 11 '12 at 14:27
  • You could update the database as you would on your local environment; however, assuming you have controllers/actions/models/views to back up what you're trying to do. – user1477388 Sep 11 '12 at 14:29
  • I have a working prototype sort of thing which works fine on my computer through debugging. I published it and uploaded the files to the FTP but it did not seem to work online. This is what lead me to think I had to make use of a remote database. – Jpin Sep 11 '12 at 14:33
  • Are you using Visual Studio? If so, you should use the Publish option since it will compile all the files for you. – user1477388 Sep 11 '12 at 14:34
  • Yes that is what I did, right clicked my solution and selected publish, then uploaded all the files which were created. – Jpin Sep 11 '12 at 14:35
  • When you say, "it did not seem to work online," how do you know? Was there an error message? – user1477388 Sep 11 '12 at 14:39
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/16552/discussion-between-jpin-and-user1477388) – Jpin Sep 11 '12 at 14:39
  • 1
    http://stackoverflow.com/questions/1570893/asp-net-how-to-deploy-app-data-to-webhost this might be helpful – BBQ Sep 11 '12 at 14:44
0

SQL CE supports binary deployment, meaning your hosted doesn't have to have anything installed and you get SQL support, however no stored procedure support (if that matters to you here) In addition you can install the SQL Compact Toolbox into Visual Studio http://sqlcetoolbox.codeplex.com/

See: http://blogs.msdn.com/b/webdev/archive/2011/01/06/how-to-bin-deploy-sql-compact-edition-4-0-and-razor-web-projects.aspx

Adam Tuliper
  • 29,982
  • 4
  • 53
  • 71