Compartir a través de


remove Element for connectionStrings (ASP.NET Settings Schema)

Removes a reference to an inherited connection string from the collection of connections strings.

This element is new in the .NET Framework version 2.0.

<remove 
   name="connection string name" 
/>

Attributes and Elements

The following sections describe attributes, child elements, and parent elements.

Attributes

Attribute Description

name

Required String attribute.

Specifies the collection key that is used to identify the connection string. If the key does not exist, no error is issued.

This attribute is the same as the name attribute that is used in the add element that was used to add the connection string to the collection.

Child Elements

None.

Parent Elements

Element Description

configuration

Specifies the required root element in every configuration file that is used by the common language runtime and the .NET Framework applications.

system.web

Specifies the root element for the ASP.NET configuration settings in a configuration file and contains configuration elements that configure ASP.NET Web applications and control how the applications behave.

connectionStrings

Specifies a collection of database connection strings, as name/value pairs, for ASP.NET applications and features

Remarks

The remove element removes a reference to an inherited connection string from the collection of connections strings that is stored in the connectionStrings element.

The connectionStrings element specifies a collection of database connection strings, as name/value pairs, for ASP.NET applications and features.

Example

The following code example shows how to remove an inherited connection string.

<configuration>
  <connectionStrings>   
    <remove 
      name="Northwind"/>   
  </connectionStrings>
</configuration>

Element Information

Configuration section handler

ConnectionStringsSection

Configuration member

Remove

Configurable locations

Machine.config

Root-level Web.config

Application-level Web.config

Virtual or physical directory–level Web.config

Requirements

Microsoft Internet Information Services (IIS) version 5.0, 5.1, or 6.0

The .NET Framework version 2.0

Microsoft Visual Studio 2003 or Visual Studio 2005

See Also

Tasks

How to: Lock ASP.NET Configuration Settings

Reference

clear Element for connectionStrings (ASP.NET Settings Schema)
configuration Element (General Settings Schema)
clear Element for connectionStrings (ASP.NET Settings Schema)
add Element for connectionStrings (ASP.NET Settings Schema)
ConnectionStringsSection
Remove

Concepts

ASP.NET Configuration Overview
Securing ASP.NET Configuration
ASP.NET Data Access Overview
Securing Data Access
ASP.NET Configuration Scenarios