Export (0) Print
Expand All
Expand Minimize

DTSFileConnectionUsageType Enumeration

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

Namespace: Microsoft.SqlServer.Dts.Runtime
Assembly: Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll)

public enum DTSFileConnectionUsageType
public enum DTSFileConnectionUsageType
public enum DTSFileConnectionUsageType

Member nameDescription
CreateFileCreates a file. The option creates the file only if it does not already exist.
CreateFolderCreates a folder.
FileExistsThe file exists.
FolderExistsThe folder exists.

Updated text: 14 April 2006

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);
        }
    }
}

Development Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.

Target Platforms

Release

History

14 April 2006

Changed content:
  • Clarified how the CreateFile works.

Community Additions

ADD
Show:
© 2014 Microsoft