0

Basically I have made a MVC3 application that connects to and updates a database that exsists on a server. This database is a test one however, and when I roll out the project live I need it to connect to the actual database. My question is how hard would it be to change the project/application to point at this new database?

I used the database first method, and am aware I would need to change my connection string. I feel it is unlikely to be as simple as that.

Any help, tips or tutorials would be greatly appreciated.

Bohdi
  • 1,295
  • 4
  • 28
  • 62
  • Extremely broad question without more information on your structure. However, it could be as simple as creating the live database and changing the connection string.. assuming everything else is the same (permissions, etc..). – Simon Whitehead Aug 28 '12 at 08:58
  • Have you tried just changing the connection string to point to a different database? If so, what specific issues did you have? – cspolton Aug 28 '12 at 09:00

3 Answers3

5

As long as the database structures are the same, it is just as simple as that.

podiluska
  • 50,950
  • 7
  • 98
  • 104
1

You just need to change the connection string.

Additionaly if you would like to deploy 2 versions of the website, each using it's own connection strings (for example for developpement and production) you can create 2 web.config files. Refer to this link SO question

Community
  • 1
  • 1
Y2theZ
  • 10,162
  • 38
  • 131
  • 200
0

It shouldn't be that hard. You just need to make sure that the database that you are working on now and the database that you are changing to are equal in table names and column names otherwise you are going to have configure it to use the new database tables and columns.

Brendan Vogt
  • 25,678
  • 37
  • 146
  • 234