Get connection string in class library project in a solution
问题 In my .net 4 solution, i have two different projects- an web application project and a class library project. In web application project, database connection string is in web.config file. I would like to access that connection string from class library project. Is it possible? if yes, how? If there is any better approach to get connection string, please let me know. 回答1: To access it from your class library add a reference to System.Configuration then use System.Confinguration