如何从另一个项目访问连接字符串 [英] How to Access a connectionstring from another project

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

问题描述

我有一个包含两个项目的解决方案.第一个项目是
第二个项目的参考.
我想传递第一个可以更改的项目的连接字符串
与用户一起进行第二个项目.

I have a solution that include two project .the first project is the
reference for the second project.
i want to pass the connectionstring of first project that can change
with user to second project.
how do this or how to send the connectionstring to second project?

推荐答案

您不能将字符串从DLL发送"到另一个项目,但是您怎么做?可以从第二个项目的DLL中询问"字符串.只需创建一个public方法或属性以在第一个项目中将其返回即可.
You can''t "send" the string from a DLL to a different project, but you can "ask" for the string from the DLL in the second project. It''s just a matter of creating a public method or property to return it in the first project.


请参阅链接....

http://stackoverflow.com/questions/6249526/how-to-从另一个项目访问连接字符串 [ ^ ]

希望对您有所帮助.
See the link....

http://stackoverflow.com/questions/6249526/how-to-access-a-connectionstring-from-another-project[^]

Hope it helps.


这篇关于如何从另一个项目访问连接字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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