By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,440 Members | 1,872 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,440 IT Pros & Developers. It's quick & easy.

When worlds collide - a settings story

P: n/a
Ok - so I havn't posted on here for a very long time. Hope everyone is ok
and I'm glad to see this place still exists outside the MS web-news reader.
Usenet for the win and all that.

The problem I am having - and I'm pretty sure I'm going to get a bit of a
laughing at - is that I have written an application back-end for use by
either Windows Forms **or** ASP.net.

Where the hecking billi-o do I store my configuration data? I don't know if
I'm going to be in HTTPApplication or Forms. The best solution for me
(because of the muli-user, multi-site nature of the application) is to be
able to store the settings in the db. Ok - that's great - fantastic... but
where do I store the connection string? Where do I store the application
name?

This is driving me mad and I think that fact is causing me to loose
coherance in my explination. I am looking for a neat solution that allows
me to deploy the same project multiple times to a number of locations
without having to edit files in the project. This is not going to happen -
the assemblies have no kernal, no running application thread outside that
presented by their enviroment. I can't just start the project and ask for
the information.

Or can I. Maybe I can force the website or application to instantiate a
settings manager on application load....

I don't know - I've written and de-borked (not debugged yet - just builds)
ten thousand lines of awsomness since Moday and I'm being held up by a
vagrant connection string and a wondering application name.

I'll be in the corner crying into my beer while you riducule my poor
application design ;)

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
May 2 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
<joshua@bee_eff_dubya_dee.co.ukwrote:
Ok - so I havn't posted on here for a very long time. Hope everyone is ok
and I'm glad to see this place still exists outside the MS web-news reader.
Usenet for the win and all that.

The problem I am having - and I'm pretty sure I'm going to get a bit of a
laughing at - is that I have written an application back-end for use by
either Windows Forms **or** ASP.net.
Interesting - I've been in the same situation very recently. It should
be possible to store name/value pairs in either web.config or
app.config, but I haven't yet worked out the best way of telling
whether to retrieve the settings from
WebConfigurationManager.AppSettings or
ConfigurationManager.AppSettings...

I haven't actually tried running it in an ASP.NET environment yet, so
hopefully the answer will be straightforward when I do. Let me know if
you get there first :)

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
May 3 '07 #2

P: n/a
ConfigurationManager.AppSettings will happily retrieve the appSettings from
any type of config file - windows forms, console, or ASP.NET.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Jon Skeet [C# MVP]" wrote:
<joshua@bee_eff_dubya_dee.co.ukwrote:
Ok - so I havn't posted on here for a very long time. Hope everyone is ok
and I'm glad to see this place still exists outside the MS web-news reader.
Usenet for the win and all that.

The problem I am having - and I'm pretty sure I'm going to get a bit of a
laughing at - is that I have written an application back-end for use by
either Windows Forms **or** ASP.net.

Interesting - I've been in the same situation very recently. It should
be possible to store name/value pairs in either web.config or
app.config, but I haven't yet worked out the best way of telling
whether to retrieve the settings from
WebConfigurationManager.AppSettings or
ConfigurationManager.AppSettings...

I haven't actually tried running it in an ASP.NET environment yet, so
hopefully the answer will be straightforward when I do. Let me know if
you get there first :)

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
May 3 '07 #3

P: n/a
Peter Bromberg [C# MVP] <pb*******@yahoo.yabbadabbadoo.comwrote:
ConfigurationManager.AppSettings will happily retrieve the appSettings from
any type of config file - windows forms, console, or ASP.NET.
Excellent. So with any luck it should just work first time. That's good
to know :)

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
May 3 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.