Click here to Skip to main content
15,904,494 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using Library for Connection in my project named DBConnection and i am calling this library in another library and this 2 nd library is called in windows application
i. e. 3 tier architecture. So the problem is how can add App.config in library and how to read that connectionstring in the class in Library.

My project dependancies as below.
DBConnection --To-- DAL library -- To-- BAL --To -- MyApplication

I am new to work on this so please give me solution.
Also i want to add my sqlserver database in Application data folder for deployement so again there is problem that how it is connected to server on client side and is it automatically use my connecion?

please somebody help me.

Thanks in Advance
Posted

Configuration information is usually set on the applications startup, and because it is changed often this is put at the highest level, ie the application executable.

You can also read configuration information at the dll level via file access, and your application can have no knowledge.

The simplest way to read config data is Dataset.ReadXml().
 
Share this answer
 
Comments
Abhinav S 3-Oct-11 0:55am    
Good answer. 5.
App.Config is a location where you could store the connection string.
Read more about it here[^].
 
Share this answer
 
Comments
Uday P.Singh 3-Oct-11 1:02am    
Agree my 5!
Abhinav S 3-Oct-11 1:06am    
Thanks Uday.
koolprasad2003 3-Oct-11 1:14am    
Good post Abhinav, +5
Abhinav S 3-Oct-11 1:17am    
Thanks.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900