Solved

ASP.NET Development SQL Server

Posted on 2011-09-06
4
311 Views
Last Modified: 2012-05-12
Experts:

What's a decent, simple way to reference a separate SQL server when developing, so that none of my testing hits the production server?  I do all my own design, development and testing on my own.  I already have a separate SQL server I can use.

I'm envisioning making a "clone" of all my databases on the soon-to-be development server, and then having to manually tweak connectionstrings in web.config every time I release.  What's the proper way to do this?
0
Comment
Question by:tknudsen-qec
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 5

Expert Comment

by:zvytas
ID: 36489393
I used to use custom DNS for this. Your connection string would look something like this:

"...;Server=SQLServer;..."

You than create custom DNS entries - on your development machine it will point to the DEV SQL server. On Production server it will point to Production SQL server.

In this case you don't need to worry about changing connections strings at all.

Hope that helps.
0
 
LVL 3

Author Comment

by:tknudsen-qec
ID: 36489467
That's certainly worth an accepted or assisted solution.  Ideally I'd have an alternative to bounce off the boss in case this notion doesn't stick.  If I understand correctly, we'd have to remember to set up the DNS any time we migrated/rebuilt/whatevered the production or development machine.

Is this the commonly held practice?  Is there another common method?

I was thinking maybe when I switch my application from DEBUG to RELEASE it could use a separate list of connection strings.  Is this possible/normal/intelligent?
0
 
LVL 5

Accepted Solution

by:
zvytas earned 500 total points
ID: 36489620
Yes, your understanding is correct - DNS setup would have to be done every time code is migrated.

Another commonly used option is web.config transformation. You can find more info about this here:

http://blogs.msdn.com/b/webdevtools/archive/2010/10/26/asp-net-web-projects-web-debug-config-amp-web-release-config.aspx
http://drdobbs.com/visualstudio/224201017

Yet another widely used option is modifying config files in the build process, however you need CI environment for that (CruiseControl, TeamCity or similar).
0
 
LVL 3

Author Closing Comment

by:tknudsen-qec
ID: 36489738
zvytas

Thanks for all.  Very informative.

tk
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question