473,327 Members | 1,979 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

from test to production

Hi all,

how are you guys handling the deployment and settings from a test server to
a production server?
In particular, if I have a db connection in my web.config pointing to my
test db server, do i need to modify it manualy on the productionserver once
the site has been deployed?

I have the same question for sql reporting services, but i'll post that in
another forum.

Thanks in advance.
Eric
Nov 19 '05 #1
4 1357
Hi Eric,

I'm not sure if this is the best way to do this, here is how I'm currently
handling the connection string/which mail server/etc. solution in my apps.

Private Function GetDSN() As String
Dim strtest As String
strtest = Me.Server.MapPath("test.txt").ToLower
If (strtest.LastIndexOf("tempprojectsfolder") <> -1) Then
Return "production connection string"
Else
Return "dev connection string"
End If
End Function

The 'test.txt' file doesn't need to exist. I use the LastIndexOf to check
for a folder in the path that I know only exists in the developers'
environments. If it doesn't find it then I know I'm on the production
server and I return the correct string. You can also expand this to check
for QA or whatever else. Just make sure if you have multiple developers
that they stay uniform as far as their directory structure and you should be
good to go. I also use this to determine other servers like which SMTP
server to use and stuff. Good luck! Ken.

--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight
If you sign up under me and need help, email me.

"ericvdb" <er******@gmail.com> wrote in message
news:O4**************@tk2msftngp13.phx.gbl...
Hi all,

how are you guys handling the deployment and settings from a test server to a production server?
In particular, if I have a db connection in my web.config pointing to my
test db server, do i need to modify it manualy on the productionserver once the site has been deployed?

I have the same question for sql reporting services, but i'll post that in
another forum.

Thanks in advance.
Eric

Nov 19 '05 #2
Hi Eric,

Here's how we handled that one in our small group. We all used the same
web.config file but each put in a key to handle our local machines. By
detecting the machine name, we could pick up the correct connection string.
Here's the idea. Let us know if this helps?

Ken
Microsoft MVP [ASP.NET]
Toronto
Private Sub Page_Load _
(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles MyBase.Load
Dim strConnection As String
Dim strSERVER_NAME As String = _
Replace(Context.Request.ServerVariables("SERVER_NA ME"), ".", "_")
strConnection = ConfigurationSettings.AppSettings _
(strSERVER_NAME & "_db")
Label1.Text = strConnection
End Sub

web.config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>

<appSettings>
<add key="localhost_db" value="connectionstringforlocalhost"/>
<add key="www_mydomain_com_db" value="connectionstringforproduction"/>
<add key="p4320_db" value="connectionstringformymachine"/>

</appSettings>
<system.web>
.....

"ericvdb" <er******@gmail.com> wrote in message
news:O4**************@tk2msftngp13.phx.gbl...
Hi all,

how are you guys handling the deployment and settings from a test server
to
a production server?
In particular, if I have a db connection in my web.config pointing to my
test db server, do i need to modify it manualy on the productionserver
once
the site has been deployed?

I have the same question for sql reporting services, but i'll post that in
another forum.

Thanks in advance.
Eric


Nov 19 '05 #3
Hello
Yeah offcourse you need to modify to the online db server .
you will must change the web.config , and will modify your conection string.
other wise you will need to write some logic to check that if it is online
server then user this connection string Else use local connection string

Kind Regards
Malik Asif

"ericvdb" <er******@gmail.com> wrote in message
news:O4**************@tk2msftngp13.phx.gbl...
Hi all,

how are you guys handling the deployment and settings from a test server to a production server?
In particular, if I have a db connection in my web.config pointing to my
test db server, do i need to modify it manualy on the productionserver once the site has been deployed?

I have the same question for sql reporting services, but i'll post that in
another forum.

Thanks in advance.
Eric

Nov 19 '05 #4
Another tip is to keep environment specific app settings in an
external file.

Web.config looks like:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<compilation defaultLanguage="c#" debug="false" />
</system.web>

<appSettings file="production.config"/>

</configuration>

And in production.config:

<appSettings>
<add key="ConnectionInfo"
value="server=foo;..." />
</appSettings>

You'd still need to modify web.config to change value like debug from
true to false, but at least production settings can live unchanged in
a file all thier own.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Wed, 23 Feb 2005 22:26:04 +0100, "ericvdb" <er******@gmail.com>
wrote:
Hi all,

how are you guys handling the deployment and settings from a test server to
a production server?
In particular, if I have a db connection in my web.config pointing to my
test db server, do i need to modify it manualy on the productionserver once
the site has been deployed?

I have the same question for sql reporting services, but i'll post that in
another forum.

Thanks in advance.
Eric


Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: zacware | last post by:
Hi! What started out as a simple test of mysql has turned into what is quickly becoming a replacement for our entire business system and web site The bad news is that we are now wrestling...
7
by: Mike | last post by:
I have to pass a date from a form to a report query. I have written a query that works fine when I execute from SQL view, But I dont know how to pass a value from the form to this query. SELECT...
4
by: ATS | last post by:
BUG/PRODUCTION-DOWN: UserControl running from HTML not working. Someone please help, I have a production down situation. For whatever reason, UserControls are not owkring from HTML/IE. When...
6
by: Ian Williamson | last post by:
Greetings, My company has an ASP.NET based enterprise product that is undergoing some changes and I need some community input to help solve a problem. In the current implementation, any given...
20
by: Development - multi.art.studio | last post by:
Hello everyone, i just upgraded my old postgres-database from version 7.1 to 7.4.2. i dumped out my 7.1 database (with pg_dump from 7.1) as an sql-file with copy-commands and to one file using...
2
by: fastfish | last post by:
I have a split db that on the dev versions w/ test data in the tables i have edited the relationships. Is there a way to move the relationships I have created in the dev db to the production db?...
29
by: Tony Girgenti | last post by:
Hello. I'm developing and testing a web application using VS.NET 2003, VB, .NET Framework 1.1.4322, ASP.NET 1.1.4322 and IIS5.1 on a WIN XP Pro, SP2 computer. I'm using a web form. How do I...
1
by: Mufasa | last post by:
I'm working at a small company that has been very lax about moving things from test to production. We are now going to start doing some real processes for doing this. Does anybody have any...
0
by: Mikelowe | last post by:
Would like to know is there an automated way to copy the maxvalue of sequence number from db2 production to db2 test. When we copy data from our production that uses a sequence number value as its...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.