471,066 Members | 1,341 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,066 software developers and data experts.

Response.Buffer and Resonse.Flush

I'm trying to execute a DTS package through an ASP.Net web page. I want it
to output the successful completion of each step. I have pasted my code
below. It executes and output what I want, but only when the DTS has
finished executing.

Please help...

Dim oPackage As New DTS.Package

Dim oStep As DTS.Step

Dim oRow As TableRow, oCell(1) As TableCell

Dim lErr As Long, sSource As String, sDesc As String

' Load Package

oPackage.LoadFromSQLServer(mServer, mUsername, mPassword, 0,
mDTSOwnerPassword, , , vDTSPackageName)

' Set Exec on Main Thread

For Each oStep In oPackage.Steps

oStep.ExecuteInMainThread = True

Next

' Execute

oPackage.Execute()

oRow = New TableRow

oCell(0) = New TableCell

oCell(1) = New TableCell

oRow.CssClass = "Heading"

oCell(0).Width = Unit.Pixel(250)

oCell(0).Text = "Step Description"

oCell(1).Width = Unit.Pixel(350)

oCell(1).Text = "Execution Status"

oRow.Cells.AddRange(oCell)

pTable.Rows.Add(oRow)

' Get Status and Error Message

For Each oStep In oPackage.Steps

If oStep.ExecutionResult = 1 Then

oRow = New TableRow

oCell(0) = New TableCell

oCell(1) = New TableCell

oStep.GetExecutionErrorInfo(lErr, sSource, sDesc)

oCell(0).Width = Unit.Pixel(250)

oCell(0).Text = oStep.Description

oCell(0).VerticalAlign = VerticalAlign.Top

oCell(1).Width = Unit.Pixel(350)

oCell(1).CssClass = "Red"

oCell(1).VerticalAlign = VerticalAlign.Top

If lErr = 0 Then

oCell(1).Text = "Failed"

Else

oCell(1).Text = "Failed<br>Error: " & lErr & "<br>Source: " & sSource &
"<br>Description: " & sDesc

End If

oRow.Cells.AddRange(oCell)

pTable.Rows.Add(oRow)

Else

oRow = New TableRow

oCell(0) = New TableCell

oCell(1) = New TableCell

oCell(0).Width = Unit.Pixel(250)

oCell(0).Text = oStep.Description

oCell(1).Width = Unit.Pixel(350)

oCell(1).Text = "Succeeded"

oRow.Cells.AddRange(oCell)

pTable.Rows.Add(oRow)

End If

Next

oPackage.UnInitialize()

oStep = Nothing

oPackage = Nothing
Nov 18 '05 #1
1 1343
Response.Flush() allows whatever is in the "Response.Buffer" to flow down to
the client and then being buffering again. I don't see anything in your
code that is trying to send anything to the client, so there would not be
anything in the buffer based on the code below. Nothing in the buffer =
nothing to flush.
"Brian" <do*****@aol.com> wrote in message
news:e6**************@TK2MSFTNGP09.phx.gbl...
I'm trying to execute a DTS package through an ASP.Net web page. I want it to output the successful completion of each step. I have pasted my code
below. It executes and output what I want, but only when the DTS has
finished executing.

Please help...

Dim oPackage As New DTS.Package

Dim oStep As DTS.Step

Dim oRow As TableRow, oCell(1) As TableCell

Dim lErr As Long, sSource As String, sDesc As String

' Load Package

oPackage.LoadFromSQLServer(mServer, mUsername, mPassword, 0,
mDTSOwnerPassword, , , vDTSPackageName)

' Set Exec on Main Thread

For Each oStep In oPackage.Steps

oStep.ExecuteInMainThread = True

Next

' Execute

oPackage.Execute()

oRow = New TableRow

oCell(0) = New TableCell

oCell(1) = New TableCell

oRow.CssClass = "Heading"

oCell(0).Width = Unit.Pixel(250)

oCell(0).Text = "Step Description"

oCell(1).Width = Unit.Pixel(350)

oCell(1).Text = "Execution Status"

oRow.Cells.AddRange(oCell)

pTable.Rows.Add(oRow)

' Get Status and Error Message

For Each oStep In oPackage.Steps

If oStep.ExecutionResult = 1 Then

oRow = New TableRow

oCell(0) = New TableCell

oCell(1) = New TableCell

oStep.GetExecutionErrorInfo(lErr, sSource, sDesc)

oCell(0).Width = Unit.Pixel(250)

oCell(0).Text = oStep.Description

oCell(0).VerticalAlign = VerticalAlign.Top

oCell(1).Width = Unit.Pixel(350)

oCell(1).CssClass = "Red"

oCell(1).VerticalAlign = VerticalAlign.Top

If lErr = 0 Then

oCell(1).Text = "Failed"

Else

oCell(1).Text = "Failed<br>Error: " & lErr & "<br>Source: " & sSource &
"<br>Description: " & sDesc

End If

oRow.Cells.AddRange(oCell)

pTable.Rows.Add(oRow)

Else

oRow = New TableRow

oCell(0) = New TableCell

oCell(1) = New TableCell

oCell(0).Width = Unit.Pixel(250)

oCell(0).Text = oStep.Description

oCell(1).Width = Unit.Pixel(350)

oCell(1).Text = "Succeeded"

oRow.Cells.AddRange(oCell)

pTable.Rows.Add(oRow)

End If

Next

oPackage.UnInitialize()

oStep = Nothing

oPackage = Nothing

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Stephanie | last post: by
5 posts views Thread by Luiz Vianna | last post: by
2 posts views Thread by David Union | last post: by
reply views Thread by brian.fairchild | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.