Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 Sql Database Issue

Author  Topic 

tarun.batra
Starting Member

3 Posts

Posted - 2007-05-30 : 01:29:13
I have developed a website in asp.net on visual studio 2003.Now i am trying to deploy it on another IIS server.I have changed the connection string and gave it the address of teh new sql database.The connection string is mentioned in .cs file.The website runs fine on the other machine however the data gets updated on the sql server on my machine.I have tried changing the address in the visual studio project on my machine and gave the address of the the other server and it runs fine.

Can someone tell me what could be the possible issue?

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2007-05-30 : 04:36:53
Can you paste your code here ???
Go to Top of Page

tarun.batra
Starting Member

3 Posts

Posted - 2007-05-30 : 05:44:30
I have used a function in .cs file which I call to get the connection string

public SqlConnection get_sqlconnection()
{
if(Environment.MachineName == "TARUN")
connection_string = "server=tarun;database=employeeinfo;user id=sa;password=sa;Trusted_Connection=no";
SqlConnection sqlconn = new SqlConnection(connection_string);
return sqlconn;
}

This is on my development machine...

public SqlConnection get_sqlconnection()
{
if(Environment.MachineName == "KMDEV")
connection_string = "server=kmdev;database=employeeinfo;user id=sa;password=;Trusted_Connection=no";
SqlConnection sqlconn = new SqlConnection(connection_string);
return sqlconn;
}

This is the updated code on the live server but it updates the data on my development server..

Go to Top of Page

AndyB13
Aged Yak Warrior

583 Posts

Posted - 2007-05-30 : 07:50:04
Did you copy the bin directory over to the new IIS server?


Beauty is in the eyes of the beerholder
Go to Top of Page

tarun.batra
Starting Member

3 Posts

Posted - 2007-05-30 : 08:16:41
yes...that was my mistake...i have resolved it now...
thankyou so much
Go to Top of Page
   

- Advertisement -