Solved

Visual Basic Solution-wide data connection

Posted on 2014-01-28
5
40 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
Comment Utility
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
Comment Utility
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
Comment Utility
>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
Comment Utility
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
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now