Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to configure for SQLstringconnect on client machine
Message
From
21/02/2005 16:11:41
 
 
General information
Forum:
ASP.NET
Category:
Deployments
Environment versions
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
00988971
Message ID:
00989016
Views:
47
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform