ado.net question - localhost vs (local)\NetSDK 
Author Message
 ado.net question - localhost vs (local)\NetSDK

I am currently taking a class on VB.Net and we are connecting to the pubs
and Northwind databases.  The connection string that I use at school and
home are different and require a code change whenever I build at one
location or the other.  I have to use "localhost" at school and
"(local)\NetSDK at home for the "Data Source".

Is there a means of either using one generic data source or determining at
runtime which should be used?

Any help would be appreciated.

Michael Fox



Wed, 13 Apr 2005 00:08:37 GMT  
 ado.net question - localhost vs (local)\NetSDK
I would suggest keeping your connection string in an XML configuration file
of your app and read it at runtime from there. You can then create two
config files: one for school, one for home and isolate the exact value of
the connection string from the rest of your application code. Read the
"Configuring Applications" section from the .NET Framework SDK
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgu...
ml/cpconconfiguringnetframeworkapplications.asp); the pre-defined
<appSettings> element
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpge...
tml/gngrfappsettingselement.asp) might be just right for you.

Hope that helps
Karol, SDE
VB.NET

--
This posting is provided "AS IS" with no warranties, and confers no rights.


Quote:
> I am currently taking a class on VB.Net and we are connecting to the pubs
> and Northwind databases.  The connection string that I use at school and
> home are different and require a code change whenever I build at one
> location or the other.  I have to use "localhost" at school and
> "(local)\NetSDK at home for the "Data Source".

> Is there a means of either using one generic data source or determining at
> runtime which should be used?

> Any help would be appreciated.

> Michael Fox



Wed, 13 Apr 2005 04:26:06 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. VB.Net Localhost for ASP.Net app?

2. ADO vs ADO.NET

3. VS.NET 2003 project back to VS.NET 2002

4. VS.Net Version vs .Net Framework version

5. Upgrading to VS.Net 2003 from VS.Net 2002

6. What is difference between '(local)\NETSDK' and '(local)\VSTE'??

7. Newbie confused: VB6 vs VB.Net vs VBScript vs VBA

8. vb.net / ado.net design question

9. Newbie question (ado.net / vb.net)

10. Newbie confused: VB6 vs VB.Net vs VBscript vs VBA

11. ADO/ADO.NET to Access db question

 

 
Powered by phpBB® Forum Software