Solved

Visual Basic Solution-wide data connection

Posted on 2014-01-28
5
43 Views
Last Modified: 2015-06-16
Good morning. I have an App.config file in one of the projects in my solutions. What I'd like is that from another project created within the same solution I am able to reuse this App.config file in this project, so that I don't have to manage two (or more) data-connection configurations.

Thanks in advance for your urgent help.
0
Comment
Question by:mhas01
  • 3
  • 2
5 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 39815182
One way to achieve this would be to use a DLL project to maintain the common config. This DLL can then be referenced in other projects to obtain the configuration.
0
 

Author Comment

by:mhas01
ID: 39816051
I'd refuse to do that ... I'd do it only if it was not possible from the built-in functions, (I mean, it would be like re-writing the whole visual basic approach) best-practices, some already existing methodology within visual studio 2012, visual basic, that I could in my solution add new projects and have these projects inherit the datasets already existing in the main project of the solution.

 I was thinking maybe the app.config file, but how? Thanks again!
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 39816312
>and have these projects inherit the datasets already existing in the main project of the solution

A solution can have a startup project, a project which is started when you run the solution itself instead of an individual project, but I am not aware of any way of having a main project which other projects can link to without having a reference to the project.
0
 

Author Comment

by:mhas01
ID: 39817952
Ain't it possible, somehow, to utilize one project's App.config file from another project as its own? Like an include?
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 39818266
You can use ConfigurationManager class to open a config file but this requires path information

http://msdn.microsoft.com/en-us/library/ms224437(v=vs.110).aspx
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question