< clear />做什么?指定连接字符串时表示? [英] What does <clear /> signify when specifying a connectionstring?

查看:48
本文介绍了< clear />做什么?指定连接字符串时表示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

针对另一个问题的答案指出:

别忘了先清除connectionStrings:

Do not forget to clear the connectionStrings first:

<connectionStrings>
   <clear />
   <add name="LocalSqlServer" connectionString="Data Source=(local);Initial Catalog=aspnetdb;Integrated Security=True" providerName="System.Data.SqlClient"/> 
</connectionStrings>






...很有趣。


... interesting. What does that do?

推荐答案

.Net中的配置文件是继承的,因此您的应用程序配置将继承计算机配置中的设置。

In .Net config files are inherited, so your applications config will inherit settings from your machines config.

< clear /> 标记将删除所有继承的连接字符串,从而避免造成混淆和潜在的问题。

The <clear/> tag will remove any inherited connection strings and thereby avoids confusion and potential problems.

在ASP.Net中,您可能有几个继承的连接字符串,因此在这里很常见。

In ASP.Net you may have several inherited connection strings, so this is very common there.

这篇关于&lt; clear /&gt;做什么?指定连接字符串时表示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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