Solved

Visual Basic Solution-wide data connection

Posted on 2014-01-28
5
41 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
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…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

910 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

24 Experts available now in Live!

Get 1:1 Help Now