共用方式為


DTSFileConnectionUsageType Enumeration

Provides information about how a connection is used by a component client.

命名空間: Microsoft.SqlServer.Dts.Runtime
組件: Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll)

語法

'宣告
Public Enumeration DTSFileConnectionUsageType
public enum DTSFileConnectionUsageType
public enum class DTSFileConnectionUsageType
public enum DTSFileConnectionUsageType
public enum DTSFileConnectionUsageType

Members

Member name Description
CreateFile Creates a file. The option creates the file only if it does not already exist.
CreateFolder Creates a folder.
FileExists The file exists.
FolderExists The folder exists.

備註

更新的文字:2006 年 4 月 14 日

This enumeration is used by the connection manager for validation purposes. For example, if the connection is being used to delete a file, and the connection is pointing to a folder, it fails validation. In addition, this enumerator indicates to the connection manager whether ambiguous names are files or folders. For example, "C:\ABC" could be the name of a new folder, or it could be a new file in the C:\ directory. This enumeration indicates if it is a file or folder.

範例

The following code example creates a package and adds a FILE ConnectionManager. The DTSFileConnectionUsageType enumeration describes the FileUsageType property as being an existing file by specifying the FileExists value.

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Dts.Runtime;

namespace Microsoft.SqlServer.SSIS.Samples
{
    class mySqlServer_Sample
    {
        static void Main(string[] args)
        {
            Package package = new Package();
            ConnectionManager cm_srcDirectory = package.Connections.Add("FILE");
            cm_srcDirectory.Name = "cm_srcDirectory";
            cm_srcDirectory.ConnectionString =  @"C:\MyFTPDirectory\*.*";
            cm_srcDirectory.Properties["FileUsageType"].SetValue(cm_srcDirectory, DTSFileConnectionUsageType.FileExists);
        }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.SqlServer.Dts.Runtime
 
Namespace Microsoft.SqlServer.SSIS.Samples
    Class mySqlServer_Sample
        Shared  Sub Main(ByVal args() As String)
            Dim package As Package =  New Package() 
            Dim cm_srcDirectory As ConnectionManager =  package.Connections.Add("FILE") 
            cm_srcDirectory.Name = "cm_srcDirectory"
            cm_srcDirectory.ConnectionString =  "C:\MyFTPDirectory\*.*"
            cm_srcDirectory.Properties("FileUsageType").SetValue(cm_srcDirectory, DTSFileConnectionUsageType.FileExists)
        End Sub
    End Class
End Namespace

平台

開發平台

如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。

目標平台

如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。

請參閱

參考

Microsoft.SqlServer.Dts.Runtime Namespace