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 1 1413
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
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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...
|
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...
|
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...
|
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"...
|
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...
|
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...
|
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. ...
|
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...
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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,...
|
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: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |