Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Script Tak Error

$
0
0

Hi In a package i have a script task to check if a file exists or not and then based on the conditions to process the package

Public Sub Main()
		'
        ' Add your code here
        Dim di As DirectoryInfo = New DirectoryInfo("F:\")
        Dim fi As FileInfo() = di.GetFiles("MarionCT*.TXT")
        If fi.Length > 0 Then
            Dts.Variables("User::ODDYSEYSourceFilesExist").Value = True
        Else
            Dts.Variables("User::ODDYSEYSourceFilesExist").Value = False
        End If
        Dts.TaskResult = ScriptResults.Success
    End Sub

But I'm getting the below errors:

Error 1 Type 'DirectoryInfo' is not defined. 

Error 2 Type 'FileInfo' is not defined.

Where should i define?

Thanks


SV


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>