Free for PREMIUM members
static void Main()
// If you have an SSIS variable that has the file name, read in the value of this variable
Logfile = Dts.Variables["LogFile"].Value
using (StreamReader reader = new StreamReader(LogFile))
line = reader.ReadLine();
Open in new window
Public Sub Main()
Dim LogFile As String
Dim ErrorCode As String
LogFile = Me.Dts.Variables("LogFile").Value
ErrorCode = Me.Dts.Variables("ErrorCode ").Value
'initialize StreamReader class for text file'
Dim streamReader As New IO.StreamReader(LogFile)
' Read the StreamReader To End and assign to local variable
Dim StreamText As String = streamReader.ReadToEnd()
If StreamText.Contains(ErrorCode) Then
Dts.Events.FireError(0, "Log File Error Check", "Error Code found in Log file", String.Empty, 0)
Dts.TaskResult = ScriptResults.Success
In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.
If you are experiencing a similar issue, please ask a related question
Join the community of 500,000 technology professionals and ask your questions.
Join & Ask a Question
Join our community for more solutions or to ask questions.
For immediate help use Live now!