如何在web.config中声明默认的连接字符串? [英] How to declare connection string default in web.config?
本文介绍了如何在web.config中声明默认的连接字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在我的web.config文件中声明连接字符串为默认字符串,这样我可能不需要在文件后面的代码中使用连接字符串的键.我正在使用MS Enterprise Library,其中有
Hi,
I want to declare connection string in my web.config file as default so that i may not need to use the key of the connection string in my code behind file. I am using MS Enterprise Library in which we have
Database db = DatabaseFactory.CreateDataBase();
Plz指南.
Plz guide.
推荐答案
http://msdn.microsoft.com/en-us/magazine/cc163766.aspx [ ^ ]
http://www.devx.com/dotnet/Article/30910/1954 [ ^ ]
如果我误解了您的问题,请随时纠正我.
希望以上信息对您有所帮助.如果您还有其他疑问,请告诉我.
http://msdn.microsoft.com/en-us/magazine/cc163766.aspx[^]
http://www.devx.com/dotnet/Article/30910/1954[^]
If i misunderstand your question, please feel free to correct me.
I hope the above information will be helpful. If you have more concerns, please let me know.
<pre lang="xml"><connectionStrings><br />
<add name="myConString" connectionString="" providerName="System.Data.SqlClient" /><br />
</connectionStrings></pre>
感谢我一直在寻找的
这篇关于如何在web.config中声明默认的连接字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文