I'm developing asp.internet mvc2 application and that i use asp.internet membership provider which utilizes ASPNETDB.mdf database. I've also my very own database and today I question how you can upload these 2 databases to server? Must I upload them as .mdf file or must i use SQL server? I favor using SQL server and when someone knows the least method to convert and upload these 2 databases it might assist me to a great deal.

Thanks ahead of time,

Funny I simply finished doing exactly the same factor. The fundamental steps are the following:

  1. From Visual Studio, load your .mdf and select "publish to provider" to create a .sql file.
  2. Open SQL Management Studio, open an association for your database and load the sql file. Give a "use yourdbname" on the top to be output the tables for your database, then run it.
  3. Now you will have the full table structure. What remains would be to modify web.config to see the brand new tables:

First the membership provider:

    <add name="AspNetSqlMembershipProvider"
         type="System.Web.Security.SqlMembershipProvider, System.Web, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a "

The role provider:

<roleManager enabled="true">
    <add name="AspNetSqlRoleProvider"
         type="System.Web.Security.SqlRoleProvider, System.Web, Version=,  Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a "

And finally the WebPart provider, if you are using it:

  <personalization defaultProvider="SqlDatabaseProviderDRDBLoginInfo">
      <add connectionStringName="ConnectionStringLoginInfo"


Within this example I known as the bond string ConnectionStringLoginInfo, but whatever take your pick, make certain you place it within the connection strings part. Not gonna paste this too :)

All of this required me a lot more than I choose to say, however when I saw my application working perfectly using the Application_Data folder erased, which was quite as soon as!

Your easiest choice for a located solution (i.e. your hosting plan isn't a Vps) would be to generate SQL scripts of the database, conveying those to *.sql files after which run them inside your located SQL connection.

I'd normally connect with my web host's SQL instance using SQL Server Management Studio and only open or paste within the scripts produced by my local copy.

Based on whether your internet host offers the service, you could also have the ability to make use of the "Publish to provider..." option in Visual Studio.