ExtendedProperties.Remove(Object) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
ExtendedProperty 컬렉션에서 ExtendedProperties 개체를 제거합니다.
public:
void Remove(System::Object ^ index);
public void Remove (object index);
member this.Remove : obj -> unit
Public Sub Remove (index As Object)
매개 변수
- index
- Object
제거할 ExtendedProperty 개체의 이름, 인덱스, ID 또는 설명입니다.
예제
다음 예에서는 ID를 사용하여 컬렉션에서 확장 속성을 제거합니다.
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Dts.Runtime;
namespace ExtendedProperties_Testing
{
class Program
{
static void Main(string[] args)
{
// The package is one of the SSIS samples.
string mySample = @"C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\CalculatedColumns Sample\CalculatedColumns\CalculatedColumns.dtsx";
// Create the application, and load the sample.
Application app = new Application();
Package pkg = app.LoadPackage(mySample, null);
// Get the Extended properties collection from the package.
ExtendedProperties myExtProps = pkg.ExtendedProperties;
// Give the count of the number of extended properties.
int numProps = myExtProps.Count;
Console.WriteLine("Current number of extended properties: {0}", numProps);
// Remove an extended property.
myExtProps.Remove("{A56842E2-11C1-487E-B670-33F25B534146}");
// Give the new count of the number of extended properties.
numProps = myExtProps.Count;
Console.WriteLine("New number of extended properties: {0}", numProps);
Console.WriteLine();
}
}
}
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.SqlServer.Dts.Runtime
Namespace ExtendedProperties_Testing
Class Program
Shared Sub Main(ByVal args() As String)
' The package is one of the SSIS samples.
Dim mySample As String = "C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\CalculatedColumns Sample\CalculatedColumns\CalculatedColumns.dtsx"
' Create the application, and load the sample.
Dim app As Application = New Application()
Dim pkg As Package = app.LoadPackage(mySample,Nothing)
' Get the extended properties collection from the package.
Dim myExtProps As ExtendedProperties = pkg.ExtendedProperties
' Give the count of the number of extended properties.
Dim numProps As Integer = myExtProps.Count
Console.WriteLine("Current number of extended properties: {0}", numProps)
' Remove an extended property.
myExtProps.Remove("{A56842E2-11C1-487E-B670-33F25B534146}")
' Give the new count of the number of extended properties.
numProps = myExtProps.Count
Console.WriteLine("New number of extended properties: {0}", numProps)
Console.WriteLine()
End Sub
End Class
End Namespace
샘플 출력:
현재 확장 속성 수: 7
새로운 확장 속성 수: 6