Solved

ASP.NET Development SQL Server

Posted on 2011-09-06
4
309 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
  • 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
kill process lock Sql server 9 54
sql server select date from a datetime column 10 28
SQL Server 2012 r2 - Make Temp Table Query Faster 5 44
SQL Insert parts by customer 12 34
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

803 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