从同一解决方案中的另一个项目web.config读取连接字符串 [英] Read connection string from another projects web.config in the same solution

查看:105
本文介绍了从同一解决方案中的另一个项目web.config读取连接字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,



我在解决方案中有三个项目,我在一个解决方案中有web.config。

现在我想从web.config读取从一个项目到另一个项目的连接字符串。

请在这方面帮助我



任何帮助将非常感谢。



谢谢

RK

解决方案

亲爱的朋友,



您可以将文件添加为链接将文件发送到您的某个项目。



使用添加现有项目到要添加文件的项目 - 打开按钮有一个小向下箭头,如果你单击,你可以选择添加为链接。



这将添加文件作为原始位置的链接,这意味着你只有一个物理文件。



关于 c#get connection的约329,000个结果来自另一个项目网络配置的字符串



如果它可以帮助你,请不要忘记将其标记为你的答案。< br $>






问候



Varun Sareen


我刚刚从web项目本身读取了connectionstring。

使用该引用,我使用configsingleton模式将connectionstring存储为类文件,我在整个应用程序中使用。



谢谢

Hi Friends,

I have three projects in the solution, in which I have web.config in one solution.
Now I want to read connection string from web.config from one project to another project.
Please help me in this regards

Any help will be greatly appreciated.

Thanks
RK

解决方案

Dear Friend,

You can Add the files as a link to the file to one of your projects.

Use Add an Existing Item to the project you want to add the file to - the Open button has a small down arrow, if you click that you can select Add as Link.

This will add the file as a link from the original location, meaning you only have one physical file.

About 329,000 results on "c# get connection string from another project web config"

Please don''t forget to mark this as your answer if it helps you out.



Regards

Varun Sareen


I just read connectionstring from web project itself.
With that reference, I use configsingleton pattern to store the connectionstring as class file and I used all over the application.

Thanks


这篇关于从同一解决方案中的另一个项目web.config读取连接字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆