Problem connecting to the database after changing the database server

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Jan 2005
Posts: 7
Reputation: Jayakumar R is an unknown quantity at this point 
Solved Threads: 0
Jayakumar R Jayakumar R is offline Offline
Newbie Poster

Problem connecting to the database after changing the database server

 
0
  #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?
Reply With Quote Quick reply to this message  
Join Date: Aug 2004
Posts: 298
Reputation: Cain is an unknown quantity at this point 
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

 
0
  #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 Quick reply to this message  
Join Date: Jan 2005
Posts: 7
Reputation: Jayakumar R is an unknown quantity at this point 
Solved Threads: 0
Jayakumar R Jayakumar R is offline Offline
Newbie Poster

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

 
0
  #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 Quick reply to this message  
Join Date: Dec 2006
Posts: 1
Reputation: mayankmca2003 is an unknown quantity at this point 
Solved Threads: 0
mayankmca2003 mayankmca2003 is offline Offline
Newbie Poster

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

 
0
  #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 Quick reply to this message  
Join Date: Jan 2007
Posts: 130
Reputation: sedgey is on a distinguished road 
Solved Threads: 8
sedgey's Avatar
sedgey sedgey is offline Offline
Junior Poster

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

 
0
  #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();
David Ridgway: so little daylight, too much caffeine
MCSD MCAD MCSE
http://web2asp.net
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 1
Reputation: dharmeshdk is an unknown quantity at this point 
Solved Threads: 0
dharmeshdk dharmeshdk is offline Offline
Newbie Poster

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

 
0
  #6
Jun 25th, 2009
i transfer my database access to sql server then problem is that
using system.data.oledb; write in access code then
using system.data.sqlclient write in sql server then
problem is that i can't write the using System.Data.SqlClient because inassembly i can add referrence.hoe i add the erence in that.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC