ConnectionStringSettingsCollection 클래스
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
public ref class ConnectionStringSettingsCollection sealed : System::Configuration::ConfigurationElementCollection
[System.Configuration.ConfigurationCollection(typeof(System.Configuration.ConnectionStringSettings))]
public sealed class ConnectionStringSettingsCollection : System.Configuration.ConfigurationElementCollection
[<System.Configuration.ConfigurationCollection(typeof(System.Configuration.ConnectionStringSettings))>]
type ConnectionStringSettingsCollection = class
inherit ConfigurationElementCollection
Public NotInheritable Class ConnectionStringSettingsCollection
Inherits ConfigurationElementCollection
상속
ConnectionStringSettingsCollection
특성
예제
다음 예제에서는 에 액세스하는 방법을 보여 있습니다 ConnectionStringSettingsCollection .
static void ShowConnectionStrings()
{
// Get the application configuration file.
System.Configuration.Configuration config =
ConfigurationManager.OpenExeConfiguration(
ConfigurationUserLevel.None);
// Get the conectionStrings section.
ConnectionStringsSection csSection =
config.ConnectionStrings;
for (int i = 0; i <
ConfigurationManager.ConnectionStrings.Count; i++)
{
ConnectionStringSettings cs =
csSection.ConnectionStrings[i];
Console.WriteLine(" Connection String: \"{0}\"",
cs.ConnectionString);
Console.WriteLine("#{0}", i);
Console.WriteLine(" Name: {0}", cs.Name);
Console.WriteLine(" Provider Name: {0}",
cs.ProviderName);
}
}
Shared Sub ShowConnectionStrings()
' Get the application configuration file.
Dim config _
As System.Configuration.Configuration = _
ConfigurationManager.OpenExeConfiguration( _
ConfigurationUserLevel.None)
' Get the conectionStrings section.
Dim csSection _
As ConnectionStringsSection = _
config.ConnectionStrings
For i As Integer = 0 To ConfigurationManager.ConnectionStrings.Count - 1
Dim cs As ConnectionStringSettings = _
csSection.ConnectionStrings(i)
Console.WriteLine( _
" Connection String: ""{0}""", cs.ConnectionString)
Console.WriteLine("#{0}", i)
Console.WriteLine(" Name: {0}", cs.Name)
Console.WriteLine( _
" Provider Name: {0}", cs.ProviderName)
Next i
End Sub
다음 예제는 이전 예제에서 사용한 구성 파일에서 발췌한 것입니다.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<connectionStrings>
<add name="ConnStr1" connectionString="LocalSqlServer: data source=127.0.0.1;Integrated Security=SSPI;Initial Catalog=aspnetdb"
providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>
개체에는 ConnectionStringSettingsCollection 개체의 ConnectionStringSettings 컬렉션이 포함되어 있습니다. 각 ConnectionStringSettings 개체는 구성 파일 섹션의 <connectionStrings>
단일 항목을 나타냅니다.
생성자
속성
메서드
Add(ConnectionStringSettings)
컬렉션에 ConnectionStringSettings 개체를 추가합니다.
BaseAdd(ConfigurationElement)
구성 요소를 ConfigurationElementCollection 에 추가합니다.
(다음에서 상속됨 ConfigurationElementCollection )
BaseAdd(ConfigurationElement, Boolean)
구성 요소를 구성 요소 컬렉션에 추가합니다.
(다음에서 상속됨 ConfigurationElementCollection )
BaseAdd(Int32, ConfigurationElement)
구성 요소를 구성 요소 컬렉션에 추가합니다.
(다음에서 상속됨 ConfigurationElementCollection )
BaseClear()
컬렉션에서 구성 요소 개체를 모두 제거합니다.
(다음에서 상속됨 ConfigurationElementCollection )
BaseGet(Int32)
지정된 인덱스 위치에 있는 구성 요소를 가져옵니다.
(다음에서 상속됨 ConfigurationElementCollection )
BaseGet(Object)
지정된 키가 있는 구성 요소를 반환합니다.
(다음에서 상속됨 ConfigurationElementCollection )
BaseGetAllKeys()
ConfigurationElementCollection 에 포함된 모든 구성 요소의 키 배열을 반환합니다.
(다음에서 상속됨 ConfigurationElementCollection )
BaseGetKey(Int32)
지정된 인덱스 위치에 있는 ConfigurationElement 의 키를 가져옵니다.
(다음에서 상속됨 ConfigurationElementCollection )
BaseIndexOf(ConfigurationElement)
지정된 ConfigurationElement 의 인덱스를 나타냅니다.
(다음에서 상속됨 ConfigurationElementCollection )
BaseIsRemoved(Object)
지정된 키가 있는 ConfigurationElement 가 ConfigurationElementCollection 에서 제거되었는지 여부를 나타냅니다.
(다음에서 상속됨 ConfigurationElementCollection )
BaseRemove(Object)
컬렉션에서 ConfigurationElement 를 제거합니다.
(다음에서 상속됨 ConfigurationElementCollection )
BaseRemoveAt(Int32)
지정된 인덱스 위치에서 ConfigurationElement 를 제거합니다.
(다음에서 상속됨 ConfigurationElementCollection )
Clear()
컬렉션에서 ConnectionStringSettings 개체를 모두 제거합니다.
CopyTo(ConfigurationElement[], Int32)
ConfigurationElementCollection 의 내용을 배열에 복사합니다.
(다음에서 상속됨 ConfigurationElementCollection )
CreateNewElement()
파생 클래스에서 재정의할 때 새 ConfigurationElement 를 만듭니다.
(다음에서 상속됨 ConfigurationElementCollection )
CreateNewElement(String)
파생 클래스에서 재정의될 때 새 ConfigurationElement 를 만듭니다.
(다음에서 상속됨 ConfigurationElementCollection )
DeserializeElement(XmlReader, Boolean)
구성 파일에서 XML을 읽습니다.
(다음에서 상속됨 ConfigurationElement )
Equals(Object)
ConfigurationElementCollection 을 지정된 개체와 비교합니다.
(다음에서 상속됨 ConfigurationElementCollection )
GetElementKey(ConfigurationElement)
파생 클래스에서 재정의될 때 지정된 구성 요소의 요소 키를 가져옵니다.
(다음에서 상속됨 ConfigurationElementCollection )
GetEnumerator()
IEnumerator 을 반복하는 데 사용되는 ConfigurationElementCollection 를 가져옵니다.
(다음에서 상속됨 ConfigurationElementCollection )
GetHashCode()
ConfigurationElementCollection 인스턴스를 나타내는 고유 값을 가져옵니다.
(다음에서 상속됨 ConfigurationElementCollection )
GetTransformedAssemblyString(String)
지정된 어셈블리 이름의 변환된 버전을 반환합니다.
(다음에서 상속됨 ConfigurationElement )
GetTransformedTypeString(String)
지정된 형식 이름의 변환된 버전을 반환합니다.
(다음에서 상속됨 ConfigurationElement )
GetType()
현재 인스턴스의 Type 을 가져옵니다.
(다음에서 상속됨 Object )
IndexOf(ConnectionStringSettings)
전달된 ConnectionStringSettings 개체의 컬렉션 인덱스를 반환합니다.
Init()
ConfigurationElement 개체를 초기 상태로 설정합니다.
(다음에서 상속됨 ConfigurationElement )
InitializeDefault()
ConfigurationElement 개체 값의 기본 집합을 초기화하는 데 사용됩니다.
(다음에서 상속됨 ConfigurationElement )
IsElementName(String)
지정된 ConfigurationElement 가 ConfigurationElementCollection 에 있는지 여부를 나타냅니다.
(다음에서 상속됨 ConfigurationElementCollection )
IsElementRemovable(ConfigurationElement)
지정한 ConfigurationElement 를 ConfigurationElementCollection 에서 제거할 수 있는지 여부를 나타냅니다.
(다음에서 상속됨 ConfigurationElementCollection )
IsModified()
파생 클래스에서 재정의될 때 이 ConfigurationElementCollection 이 마지막으로 저장되거나 로드된 후 수정되었는지 여부를 나타냅니다.
(다음에서 상속됨 ConfigurationElementCollection )
IsReadOnly()
ConfigurationElementCollection 개체가 읽기 전용인지 여부를 나타냅니다.
(다음에서 상속됨 ConfigurationElementCollection )
ListErrors(IList)
이 ConfigurationElement 개체와 모든 하위 요소의 잘못된 속성 오류를 전달된 목록에 추가합니다.
(다음에서 상속됨 ConfigurationElement )
MemberwiseClone()
현재 Object 의 단순 복사본을 만듭니다.
(다음에서 상속됨 Object )
OnDeserializeUnrecognizedAttribute(String, String)
역직렬화하는 동안 알 수 없는 특성을 발견했는지 여부를 나타내는 값을 가져옵니다.
(다음에서 상속됨 ConfigurationElement )
OnDeserializeUnrecognizedElement(String, XmlReader)
구성 시스템에서 예외를 throw하도록 합니다.
(다음에서 상속됨 ConfigurationElementCollection )
OnRequiredPropertyNotFound(String)
필수 속성이 없으면 예외를 throw합니다.
(다음에서 상속됨 ConfigurationElement )
PostDeserialize()
deserialization 후에 호출됩니다.
(다음에서 상속됨 ConfigurationElement )
PreSerialize(XmlWriter)
serialization 전에 호출됩니다.
(다음에서 상속됨 ConfigurationElement )
Remove(ConnectionStringSettings)
컬렉션에서 지정된 ConnectionStringSettings 개체를 제거합니다.
Remove(String)
컬렉션에서 지정된 ConnectionStringSettings 개체를 제거합니다.
RemoveAt(Int32)
컬렉션의 지정된 인덱스에 있는 ConnectionStringSettings 개체를 제거합니다.
Reset(ConfigurationElement)
파생 클래스에서 재정의될 때 ConfigurationElementCollection 을 수정되지 않은 상태로 다시 설정합니다.
(다음에서 상속됨 ConfigurationElementCollection )
ResetModified()
파생 클래스에서 재정의될 때 IsModified() 속성의 값을 false
로 다시 설정합니다.
(다음에서 상속됨 ConfigurationElementCollection )
SerializeElement(XmlWriter, Boolean)
파생 클래스에서 재정의될 때 구성 파일의 XML 요소에 구성 데이터를 씁니다.
(다음에서 상속됨 ConfigurationElementCollection )
SerializeToXmlElement(XmlWriter, String)
파생 클래스에서 구현될 때 구성 요소의 외부 태그를 구성 파일에 씁니다.
(다음에서 상속됨 ConfigurationElement )
SetPropertyValue(ConfigurationProperty, Object, Boolean)
속성을 지정된 값으로 설정합니다.
(다음에서 상속됨 ConfigurationElement )
SetReadOnly()
IsReadOnly() 개체와 모든 하위 요소에 대해 ConfigurationElementCollection 속성을 설정합니다.
(다음에서 상속됨 ConfigurationElementCollection )
ToString()
현재 개체를 나타내는 문자열을 반환합니다.
(다음에서 상속됨 Object )
Unmerge(ConfigurationElement, ConfigurationElement, ConfigurationSaveMode)
구성 계층 구조의 여러 수준에서 구성 정보를 병합한 결과를 되돌립니다.
(다음에서 상속됨 ConfigurationElementCollection )
명시적 인터페이스 구현
확장 메서드
적용 대상
추가 정보