|
|
|
date: 23 Apr 2006 00:12:59 -0700,
group: microsoft.public.dotnet.datatools
back
Re: why store a user's connection string in appsettings?
Hello Graham,
GC> But all the "best practive" data access methods I'm encountering
GC> (creating a strongly typed DataSet, for example, or using the Data
GC> Access Application Block) are built off a hard-coded connection
GC> string. I'm creating a class library to encapsulate data access to a
GC> particular database, but I have no way of passing it a connection
GC> string, since it runs with the connection string it was compiled
GC> with. That's just goofy. But it seems like all the demo apps I'm
GC> finding fit that paradigm.
It's just to keep the samples simple
GC> What am I missing? Something pretty basic, I'm sure. Can the
GC> application's configuration be updated by the application itself? (I
GC> don't see how, since App-scope settings are read-only.)
Idea in changing this data manually, without recompiling your app.
GC> Philosophically, does anyone really distribute applications with
GC> embedded connection strings? Am I correct in thinking that without a
GC> connection string in app.config, the DAAB is unusable?
No, just keep your connection string in external file
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour
"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
date: Sun, 23 Apr 2006 11:59:53 +0000 (UTC)
author: Michael Nemtsev
Re: why store a user's connection string in appsettings?
Michael, thanks for your reply. I'm still quite baffled, though.
MN> Idea in changing this data manually, without recompiling your app.
Um, but it's the application (well, the user running the application)
that I want to have select a connection (not to mention enter their own
password). Since the application can't update application-scope
settings, I'm confused about what you mean by "manually."
MN> No, just keep your connection string in external file
Well, setting aside for a moment that I don't really want connection
data persisted to disk (I'll assume there's an encryption methodology
I've not yet run across), I've not found an example of how to make this
work. The code for the DAAB to connect to a database ---
DatabaseFactory.CreateDatabase() --- will use the connection string in
the running application's app.config (e.g. application.exe.config). I
suppose I could write a helper "login" application that would accept a
user's connection information (server, user id, password), write it to
the .config file (encrypting it, I'd hope), and then start up the main
application... is that how it's usually done, then?
g.
date: 23 Apr 2006 13:30:20 -0700
author: Graham Charles
Re: why store a user's connection string in appsettings?
The DAAB also allows the connection string information to be encrypted.
"Graham Charles" wrote in message
news:1145824220.881016.262300@i40g2000cwc.googlegroups.com...
> Michael, thanks for your reply. I'm still quite baffled, though.
>
> MN> Idea in changing this data manually, without recompiling your app.
>
> Um, but it's the application (well, the user running the application)
> that I want to have select a connection (not to mention enter their own
> password). Since the application can't update application-scope
> settings, I'm confused about what you mean by "manually."
>
> MN> No, just keep your connection string in external file
>
> Well, setting aside for a moment that I don't really want connection
> data persisted to disk (I'll assume there's an encryption methodology
> I've not yet run across), I've not found an example of how to make this
> work. The code for the DAAB to connect to a database ---
> DatabaseFactory.CreateDatabase() --- will use the connection string in
> the running application's app.config (e.g. application.exe.config). I
> suppose I could write a helper "login" application that would accept a
> user's connection information (server, user id, password), write it to
> the .config file (encrypting it, I'd hope), and then start up the main
> application... is that how it's usually done, then?
>
> g.
>
date: Mon, 24 Apr 2006 13:11:59 +1000
author: Brendan Green
|
|