473,390 Members | 1,393 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,390 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 1412
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Copa | last post by:
Hello, I am testing buffering an asp page and Flushing information out to the browser, hence i wrote the code in an asp page that follows this Message Post. The loops are suppose to simulate...
7
by: Stephanie | last post by:
If response.buffer is set to true, and no response.flush has been executed, is it accurate to expect that my browser should not be rendering the content which I (well Ok, someone else) is sending...
5
by: Luiz Vianna | last post by:
Guys, I need to send some info to my client while I'm processing some stuff. The flow will be something like : -process -response -process -response .... I imagine to use response.flush...
2
by: David Union | last post by:
Hi. I'm posting this here because I don't know exactly what the best group is. This is for an aspx page with Visual Basic as the code-behind page. I am doing very simple code... in the middle...
0
by: brian.fairchild | last post by:
I have a downloader page in my asp.net application that looks at a session variable to get the path to the file, checks it then downloads it using the Response object. When the "File Download"...
12
by: Jim Rodgers | last post by:
I have a big asp file that has an error under certain conditions -- totally repeatable. However, it only fails when I set response.buffer = True at the top. WHen I set it False in order to debug...
7
by: eventuranza | last post by:
For my application, there users can upload and download files to the a webserver. Straightforward enough. However, when they upload a PDF file then try to download it, the file seems to be...
2
by: Michael D. Ober | last post by:
When I single step through the code below, it sends back the PDF file that is retrieved in the line fm.GetAccountPDF(...). When I run without single stepping, I get the master page for this page. ...
14
by: S N | last post by:
I am using the following code to hide the download url of files on my website. The code uses Response.Binarywrite to send file to the client. Kindly indicate the maximum size of the file that can be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.