User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 391,584 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,650 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 5671 | Replies: 4
Reply
Join Date: Jan 2005
Posts: 7
Reputation: Jayakumar R is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Jayakumar R Jayakumar R is offline Offline
Newbie Poster

Problem connecting to the database after changing the database server

  #1  
Jan 11th, 2005
The configuration in our setup is one Web Server and one database server running SQL Server. With the current connection string it works. Recently we moved the database server to another machine with a different ip but with the same name. We used the name and not the ip in the connect string. We did not change the connection string. But when we restarted the web server the connection held and the old program worked without changing anything in the code. Is it necessary that everytime we change the database server the web server has to be rebooted. What is the reason for this behavior? Is there a better way to do it rather than start the web server again?
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2004
Location: Pasadena, Maryland
Posts: 298
Reputation: Cain is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 2
Cain's Avatar
Cain Cain is offline Offline
Posting Whiz in Training

Re: Problem connecting to the database after changing the database server

  #2  
Jan 11th, 2005
sounds like a DNS conflict. Do you have two machines named like :billybob (10.1.1.5)
and :billybob (10.1.1.6) with just differing IPs on the same network?

this is a big bad no-no if you do. you should be able to connect to a port on the new
system by using the IP in place of the name string like so:
http://billybob:6060 {which one of the above is it?} or better yet: http://10.1.1.6:6060 hey Im DNS and I can tell!

:mrgreen:
I used up all my money on you baby...
... and I want it BACK.
Reply With Quote  
Join Date: Jan 2005
Posts: 7
Reputation: Jayakumar R is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Jayakumar R Jayakumar R is offline Offline
Newbie Poster

Re: Problem connecting to the database after changing the database server

  #3  
Jan 12th, 2005
Originally Posted by Cain
sounds like a DNS conflict. Do you have two machines named like :billybob (10.1.1.5)
and :billybob (10.1.1.6) with just differing IPs on the same network?

this is a big bad no-no if you do. you should be able to connect to a port on the new
system by using the IP in place of the name string like so:
http://billybob:6060 {which one of the above is it?} or better yet: http://10.1.1.6:6060 hey Im DNS and I can tell!

:mrgreen:
Thanks for your reply. Well the problem was like this. We had a Web server that ran both asp as well as ap.net applications. The web server had dsn's for asp applications for database connectivity to the database server. We had a database server with name say abc and ip say: 10.1.1.5 as mentioned by you. We transferred the database to a new machine and named it abc but the ip was say: 10.1.1.6. The dns entry was abc and 10.1.1.5. We removed the original machine (10.1.1.5) from the network and placed the new machine in the network. We did not change the dns entry. At this point all our asp applications worked but the asp.net did not work and gave a server could not find error. We rebooted the web server now and then this worked also. However when we ran some vbscript on the command line it did not work and then we thought it could be a dns error and changed the wrong entry. I am curious about the behavior between asp and asp.net application and more so about the asp.net application when the web server was rebooted. As you rightly said the problem was in the dns entry but the behvior of the asp.net application is strange!!!!
Reply With Quote  
Join Date: Dec 2006
Posts: 1
Reputation: mayankmca2003 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
mayankmca2003 mayankmca2003 is offline Offline
Newbie Poster

Re: Problem connecting to the database after changing the database server

  #4  
Dec 30th, 2006
hai
how i connect ms-access as database with asp.net 2003 using c#
Mayank Kushwaha

Software Developer
09811699357
Noida
Reply With Quote  
Join Date: Jan 2007
Location: Japan
Posts: 70
Reputation: sedgey is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 4
sedgey sedgey is offline Offline
Junior Poster in Training

Re: Problem connecting to the database after changing the database server

  #5  
Jan 2nd, 2007
Something like this depending on your database name and location:

OleDbConnection conn;
OleDbCommand comm;
OleDbDataReader dr;
conn = new OleDbConnection("Provider = Microsoft.Jet.OLEDB.4.0; Data Source = C:\\db1.mdb");
comm = new OleDbCommand("Select * from Table1",conn);
conn.Open();
conn.Close();
sedgey: so little daylight, too much caffeine
MCSD MCAD MCSE
http://www.thefriendlybuilder.co.uk,
http://www.sheetmusicdirect.com
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb ASP.NET Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the ASP.NET Forum

All times are GMT -4. The time now is 10:56 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC