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?

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:

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!!!!

hai
how i connect ms-access as database with asp.net 2003 using c#

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();

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.