ExtendedProperties.Remove Method
Removes an ExtendedProperty object from the ExtendedProperties collection
네임스페이스: Microsoft.SqlServer.Dts.Runtime
어셈블리: Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll)
구문
‘선언
Public Sub Remove ( _
index As Object _
)
public void Remove (
Object index
)
public:
void Remove (
Object^ index
)
public void Remove (
Object index
)
public function Remove (
index : Object
)
매개 변수
- index
The name, index, ID, or description of the ExtendedProperty object to remove.
예
The following example removes an extended property from the collection using the 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\90\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\90\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
Sample Output:
Current number of extended properties: 7
New number of extended properties: 6
스레드 보안
Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
플랫폼
개발 플랫폼
지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.
대상 플랫폼
지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.
참고 항목
참조
ExtendedProperties Class
ExtendedProperties Members
Microsoft.SqlServer.Dts.Runtime Namespace