Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to configure for SQLstringconnect on client machine
Message
De
21/02/2005 16:11:41
 
 
À
21/02/2005 14:34:29
Information générale
Forum:
ASP.NET
Catégorie:
Déploiements
Versions des environnements
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
00988971
Message ID:
00989016
Vues:
48
Glenn,

And how are you currently doing it?

You can use a config file and put the connectionstring in there:
<?xml version="1.0" standalone="yes"?>
<configuration>
  <appSettings>
    <add key="ConnectionString" value="server=MyServer;database=MyDataBase;uid=UserName;pwd=MyPassword" />
  </appSettings>
</configuration>
Not real secure, as the password is in plain view, but I'll let you figure out how to deal with that. <g> If this is on the client machine, then the config file would be called MyApp.exe.config and would reside with the EXE. We connect to our database via Web Services, and so in that case the config file is on the Web Server and is called web.config.

~~Bonnie



>When deploying a .Net app which used a SQL backend, how do you program the connect string to be both compatible on your dev machine and on the user's machine? Can I use a configuratrion file (INI) or a Reg setting? If so are there any good examples?
>
>Thanks
>
>Glenn
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform