locked
How to replace external SQL with internal database & local SQL? RRS feed

  • Question

  • User2142845853 posted

    Have an existing system that is deployed with a SQL server on a local network. The VPN is down so no connection and no testing.  

    The question is about how to change web.config or? so that it will create a LOCAL copy of a database based on the model(s) used and I could add a couple records manually so I can test.

    the add name ="DefaultConnection" connectionString is setup with the online SQL (yes it shouldnt be and will become the local instance; but when its already a running system, have tried adding a database, going thru menus; just want access to some local db so I can create whatever needed tables. Should be simple 

    Sunday, May 3, 2020 6:53 PM

All replies

  • User475983607 posted

    If you used Code First migrations then change the connection string to your local SQL instance and execute update-database.   That will create the DB and tables.

    Sunday, May 3, 2020 7:36 PM
  • User2142845853 posted

    If you used Code First migrations then change the connection string to your local SQL instance and execute update-database.   That will create the DB and tables.

    Thanks, ok but the problem is there are no local SQL instances, I deleted them.  Wait if I create a new project with some generic model and build it  wont it make a local SQL instance on the machine thats compatible?

    Sunday, May 3, 2020 9:26 PM
  • User2142845853 posted

    Made 4 databases, update the config parameter to the new SQL database(s) path.  always gets a network error or cannot get exclusive access to Master Table?

    Monday, May 4, 2020 12:53 AM