sql server - How do I link to a remote database with ASP.NET MVC? -


I have an ASP.NET MVC application and are running, using my SQL Saver Express 2005 database instance, which That's the machine running on my development. When the app is deployed to production, however, the IIS instance and the SQL Server instance will be on different logical machines. I do not know if they are different geographic boxes, but I suspect that matters.

The output DB server is currently in place, with a populated DB on it since I have read access to that example, so I have to make sure that this remote DB connection still works I want to point to this project on my god machine. The schema is the same, of course, the location and content are different.

I currently located on my development machine. There is a project linked to the MDF file. What changes should I make to change this on a DB example on a remote server?

Easy Answer: Change the connection string for your data layer (Linq to SQL? On the Web) Give .config to point out your out-of-process database indentation.

In more detail, here are the steps I have taken to divide the database from my site on my development box. By doing this, you can test this two-server configuration locally before deploying it into production.

  • Open management studio and connect to your local SQL Server Express instance (Typicaly [boxname] / SQLEXPRESS)
  • Right- Click and select Attach ...
  • Find your .mdf file in the project and open it.
  • Rename the newly attached database for the call you want to make.
  • The service account that runs the IIS application pool runs under the permissions of the database. First, create an account under the top level security / login folder, and then add that account to the new database security / user folder. For my configuration, I'm using the Networker service.
  • Now that your database is placed in the SQL Server Express as a standalone database, you can connect by using the database.

    At this point, your development is simulating the environment production environment where the database and IIS process are divided. To indicate the production database, you only have to change your connection string to production.


    Comments

    Popular posts from this blog

    python - Overriding the save method in Django ModelForm -

    html - CSS autoheight, but fit content to height of div -

    qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -