943,969 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 7899
  • ASP.NET RSS
Jan 11th, 2005
0

Problem connecting to the database after changing the database server

Expand Post »
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?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Jayakumar R is offline Offline
7 posts
since Jan 2005
Jan 11th, 2005
0

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

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:
Reputation Points: 18
Solved Threads: 2
Posting Whiz in Training
Cain is offline Offline
298 posts
since Aug 2004
Jan 12th, 2005
0

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

Quote 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!!!!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Jayakumar R is offline Offline
7 posts
since Jan 2005
Dec 30th, 2006
0

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

hai
how i connect ms-access as database with asp.net 2003 using c#
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mayankmca2003 is offline Offline
1 posts
since Dec 2006
Jan 2nd, 2007
0

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

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();
Reputation Points: 68
Solved Threads: 9
Junior Poster
sedgey is offline Offline
130 posts
since Jan 2007
Jun 25th, 2009
0

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

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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
dharmeshdk is offline Offline
1 posts
since Jun 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: ScriptManagerProxy fun days.
Next Thread in ASP.NET Forum Timeline: how to do it with iTextSharp.dll





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC