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

How change application setting in class library project programmatically?

P: n/a
In my solution, I have a client (Windows app) and a class library. The
class library project has a connection string setting that I would like to
be able to change (from the client project ultimately).

However, when I try to change the setting programmatically, it says it can't
because it's read-only. This is not the case when I want to change a
setting in the client project.

Any idea what's up? If it matters, the class library has a .dbml file since
we're using LINQ to SQL (but I don't think that has an impact).

Basically, I want the client to be able to switch which database it's
pointing to.

Thanks for any input,
Ron

Jun 27 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Apr 18, 1:49*pm, "Ronald S. Cook" <rc...@westinis.comwrote:
In my solution, I have a client (Windows app) and a class library. *The
class library project has a connection string setting that I would like to
be able to change (from the client project ultimately).

However, when I try to change the setting programmatically, it says it can't
because it's read-only. *This is not the case when I want to change a
setting in the client project.

Any idea what's up? *If it matters, the class library has a .dbml file since
we're using LINQ to SQL (but I don't think that has an impact).

Basically, I want the client to be able to switch which database it's
pointing to.

Thanks for any input,
Ron
Hi,

You can declare the connectionstring in the config of the win app and
you can access it from the dll.
Jun 27 '08 #2

P: n/a
On Apr 18, 1:49*pm, "Ronald S. Cook" <rc...@westinis.comwrote:
In my solution, I have a client (Windows app) and a class library. *The
class library project has a connection string setting that I would like to
be able to change (from the client project ultimately).

However, when I try to change the setting programmatically, it says it can't
because it's read-only. *This is not the case when I want to change a
setting in the client project.

Any idea what's up? *If it matters, the class library has a .dbml file since
we're using LINQ to SQL (but I don't think that has an impact).

Basically, I want the client to be able to switch which database it's
pointing to.

Thanks for any input,
Ron
Additionally, you could create a "Init" method for the library where
you can pass the parameters that you need.
Jun 27 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.