Thanks for your response Richard,
=======================
You say such values are ¡°easily¡± overridden in the consumer
application¡¯s app.config file. Do you mean there is an elegant mechanism
to
achieve this or do you mean to simply duplicate them and pass them from exe
to dll as part of (for instance) ¡°MyApplication.Startup¡±?
============================
Here I mean we can simply copy those setting xml element from the class
library project's "app.config" into our client consumer project's
app.config file(if need overriding, we can modify it as our need).
==========================
The Visual Studio DataSet designer will add the
connection string to the ¡°project settings¡± automatically, and saving the
path in the same place seems very sensible. So all I need now is an elegant
way to make these settings available to the application¡¯s user.
============================
Yes, the DataSet/tableAdapter is an built-in example that use the project
settings(actually link to the configuration elements in the app.config) to
store some datas such as connectionstrings. And at the development time,
those data are stored in the class library project's app.config file. After
the class library assembly is used by a certain client application(winform
or asp.net), the classes in the class library(suppose it is a TableAdapter)
will use the following data(originally stored in class library project's
app.config file:
1. If we do not override the connection strings in consumer application's
app.config file, the TableAdapter will still use its original
connectionstring value(which is compiled into assembly).
2. If we override the connection string in consumer application's
app.config file as below, the TableAdapter class(in the class library
assembly) will use the updated value from the consumer application's
app.config:
<connectionStrings>
<add name="clslib1.Properties.Settings.NorthwindConnectionString"
connectionString=" new connection string
value....................."
providerName="System.Data.SqlClient" />
</connectionStrings>
This make the settings used by class library components easy to override in
the final consumer application( at least much better than the support in
..net framework 1.1/vs 2003).
Regards,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)