RvGrah,
Instead of hard coding your connection string, why not get that value
from a config file for your app? You should be able to do something like
this in your config file:
<connectionStrings>
<add name="MyLocalSQLServer"
connectionString="Initial Catalog=aspnetdb;
data source=localhost;Integrated Security=SSPI;"
providerName="System.Data.SqlClient"/>
</connectionStrings>
And then, in your code, you should be able to do:
// Get the connection string.
string connectionString =
System.Configuration.ConfigurationManager.Connecti onStrings["MyLocalSQLServer"];
Then, all you have to do is change the value in the config file, and you
don't have to worry about re-compiling your app anytime you want to specify
a different server.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"RvGrah" <rv****************@sbcglobal.net> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
If I use a Sql Server 2005 Express copy of a database on my local
machine to develop my apps, can I then just substitute (Ctl+Shift + H
"replace all") the server name of my local machine with the server name
of our company server when I deploy this to my users?
I can't deploy versions calling my local development machine because
other apps talking to this same database are still based on VS 2003 and
some even from VB6, and they all need to talk to the same Sql Server.
Has anyone tried this? Yes, I'm going to try it myself, just loking for
input from fellow users. I want to get started in the VS 2005 world but
I'm not ready to buy the Professional version yet, want to see what I
can learn and do with Express version for a bit.
Thanx, Bob