473,394 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How change application setting in class library project programmatically?

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
2 2658
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Alpha | last post by:
Hi, I'm working on different projects that each is a class library which is run off of a main application. Can I change the output path of just the compiled DLL file to the path of the main...
9
by: Graham | last post by:
I have been having some fun learning and using the new Controls and methods in .Net 2.0 which will make my life in the future easier and faster. Specifically the new databinding practises and...
3
by: Tom | last post by:
I am writing a Visual basic .Net database application. There are many forms that first let you select and look at a DB record and then when you click a "modify" button you are allowed to change...
2
by: Juan Pedro Gonzalez | last post by:
Helo, My question is how can I exit an application from a class Library... I've got a class library wich I use to load and save user setting for my application, some of this settings are...
10
by: musosdev | last post by:
I've got a function that needs to work slightly differently on the development server from the production server, but of course I don't want to be changing code just before compiling a release...
7
by: Steven Cliff | last post by:
I have started to use the new Enterprise Library (Jan 06) and have set up a skeleton project using the DAAB. This all seems to work fine apart from when I come to secure the app.config file via...
3
by: xycos | last post by:
Hello. I apologize for asking this question as the information I need is availible via the MSDN library, however I cannot seemt o understand what I need to do, so I'm asking here. I have created...
10
by: AG | last post by:
I am trying to use a ReportViewer control in a VS 2005 web application project (not Website project). When I try to create a new report (local), I can't seem to find any method to create a...
1
by: =?Utf-8?B?d2lubGlu?= | last post by:
Hello Using VS 2005 VB.net when a class library gets created you can right click the project and add a Windows Application and then set it as the "startup project" then in the Windows...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.