M
Mike L.
Hi,
Pls, beware that I'm new to this
I've developed several web appl, either with ASP or ASP.NET. All using SQL
server as the back end.
In my development environment, I have a single server running Win2K, which
serves as Web Server and SQL server as well.
And, since my hosting (production server) using the same config; ie: using a
single server to serve both web server and SQL server; it's always been easy
for me to set my connection string in my applications. I just need to point
to "localhost" as my data source in my conn string.
It works just fine either in my developmetn server and my production server.
I just need to upload all the project files, and everything will run just
fine, just like it is in my developmetn env.
Then, my hosting decided to separated SQL server into a dedicated machine
(with, of course, diff IP).
That's when the problem started. Because, all my appl which point to
'localhost' couldn't recognize it anymore.
As with my ASP appl, I used to create a single .asp page with my connection
string in it. And just 'include' it on top of every .asp page that needs to
access data.
So, i just need to change the 'data source=' to point to the SQL server for
the production server, and use the ussual 'localhost' when use it in my
development env.
Even though it's a little bit tedious, but it can do the trick.
Now, for ASP.NET. I used to create my SQL server connection from "Server
Explorer" window, which VS automatically created a proper
conn.connectionString in my web.config
But, in every .aspx page that accesses data, (I know all of you know this) I
used to drag & drop SqlDataAdapter or SqlCommand directly onto the page,
which VS automatically created a corresponding SqlConnection based on the
connection I created in "Server Explorer". I changed the conn string in my
web.config but still can't recognize the sql server in production env. It's
because in all pages that I have SqlConn, it's still refer to my
'localhost'.
Is there any quick, efficient and effective way, that I can still work on my
development server (using localhost); and when I uploaded the projects to my
production server I can change the Sql server reference to my hosting's Sql
server IP?
Many thanks in advance,
Mike L.
Pls, beware that I'm new to this
I've developed several web appl, either with ASP or ASP.NET. All using SQL
server as the back end.
In my development environment, I have a single server running Win2K, which
serves as Web Server and SQL server as well.
And, since my hosting (production server) using the same config; ie: using a
single server to serve both web server and SQL server; it's always been easy
for me to set my connection string in my applications. I just need to point
to "localhost" as my data source in my conn string.
It works just fine either in my developmetn server and my production server.
I just need to upload all the project files, and everything will run just
fine, just like it is in my developmetn env.
Then, my hosting decided to separated SQL server into a dedicated machine
(with, of course, diff IP).
That's when the problem started. Because, all my appl which point to
'localhost' couldn't recognize it anymore.
As with my ASP appl, I used to create a single .asp page with my connection
string in it. And just 'include' it on top of every .asp page that needs to
access data.
So, i just need to change the 'data source=' to point to the SQL server for
the production server, and use the ussual 'localhost' when use it in my
development env.
Even though it's a little bit tedious, but it can do the trick.
Now, for ASP.NET. I used to create my SQL server connection from "Server
Explorer" window, which VS automatically created a proper
conn.connectionString in my web.config
But, in every .aspx page that accesses data, (I know all of you know this) I
used to drag & drop SqlDataAdapter or SqlCommand directly onto the page,
which VS automatically created a corresponding SqlConnection based on the
connection I created in "Server Explorer". I changed the conn string in my
web.config but still can't recognize the sql server in production env. It's
because in all pages that I have SqlConn, it's still refer to my
'localhost'.
Is there any quick, efficient and effective way, that I can still work on my
development server (using localhost); and when I uploaded the projects to my
production server I can change the Sql server reference to my hosting's Sql
server IP?
Many thanks in advance,
Mike L.