How to transfer ASP.NET MVC Database from LocalDb to SQL Server?

前端 未结 9 1362
小鲜肉
小鲜肉 2020-12-12 17:20

I created a new ASP.NET MVC 5 project in Visual Studio 2013 (Express for Web) and by default, the project uses LocalDb as its database, but how do you transfer or mi

9条回答
  •  甜味超标
    2020-12-12 17:27

    I had the same problem and just solved this...so the main point is default connection string...which you need to modify correctly otherwise it is pointless..and impossible to connect properly. So copy all you aspnetroles...users table to online database( they should look the same as in your local database). You can compare schema(local db) with real db. It is quit well explained by "Overlord" -> Explanation

    But after lets now correctly modify defaultconnection string That is my default string before modification:

     
    

    That is my modified default string after modification:

    
    

    servername - should be your server. portnumber - should be your server port

    It took me ages to finally get it working properly...but this small trick with default string just made it! Hops this helps

提交回复
热议问题