C
Charles
I have a Web application in VB.Net that has four seperate procdedures
which need to run in order.
Try
cnDownload.Open()
Dim cmdDeleteDownload As New
SqlCommand("ProcDeleteDownload", cnDownload)
cmdDeleteDownload.CommandType = CommandType.StoredProcedure
cmdDeleteDownload.ExecuteNonQuery()
Catch ex As Exception
sendMessage("Issue with running procDeleteDownload")
cnDownload.Close()
Exit Sub
End Try
Try
Dim cmdDownload As New SqlCommand("ProcImportDownLoad",
cnDownload)
With cmdDownload
.CommandType = CommandType.StoredProcedure
End With
Dim drDownload As SqlDataReader
cmdDownload.ExecuteNonQuery()
Catch ex As SystemException
sendMessage("Issue with running procImport")
cnDownload.Close()
Exit Sub
End Try
Try
Dim cmdInsertMembers As New
SqlCommand("ProcInsertNewDownload", cnDownload)
With cmdinsertmembers
.CommandType = CommandType.StoredProcedure
End With
Dim drInsert As SqlDataReader
cmdInsertMembers.ExecuteNonQuery()
Catch ex As Exception
sendMessage("Issue with running procInsertNewDownload")
cnDownload.Close()
Exit Sub
End Try
Try
Dim cmdInsertMembers As New SqlCommand("ProcAddMembers",
cnDownload)
cmdInsertMembers.CommandType = CommandType.StoredProcedure
cmdInsertMembers.ExecuteNonQuery()
Catch ex As Exception
sendMessage("Issue with running procAddMembers")
cnDownload.Close()
Exit Sub
End Try
Running in debug works fine but not in final release. Do I need to
handle these statements so the code waits for each procedure to finish
before proceding?
Thanks
Charles
which need to run in order.
Try
cnDownload.Open()
Dim cmdDeleteDownload As New
SqlCommand("ProcDeleteDownload", cnDownload)
cmdDeleteDownload.CommandType = CommandType.StoredProcedure
cmdDeleteDownload.ExecuteNonQuery()
Catch ex As Exception
sendMessage("Issue with running procDeleteDownload")
cnDownload.Close()
Exit Sub
End Try
Try
Dim cmdDownload As New SqlCommand("ProcImportDownLoad",
cnDownload)
With cmdDownload
.CommandType = CommandType.StoredProcedure
End With
Dim drDownload As SqlDataReader
cmdDownload.ExecuteNonQuery()
Catch ex As SystemException
sendMessage("Issue with running procImport")
cnDownload.Close()
Exit Sub
End Try
Try
Dim cmdInsertMembers As New
SqlCommand("ProcInsertNewDownload", cnDownload)
With cmdinsertmembers
.CommandType = CommandType.StoredProcedure
End With
Dim drInsert As SqlDataReader
cmdInsertMembers.ExecuteNonQuery()
Catch ex As Exception
sendMessage("Issue with running procInsertNewDownload")
cnDownload.Close()
Exit Sub
End Try
Try
Dim cmdInsertMembers As New SqlCommand("ProcAddMembers",
cnDownload)
cmdInsertMembers.CommandType = CommandType.StoredProcedure
cmdInsertMembers.ExecuteNonQuery()
Catch ex As Exception
sendMessage("Issue with running procAddMembers")
cnDownload.Close()
Exit Sub
End Try
Running in debug works fine but not in final release. Do I need to
handle these statements so the code waits for each procedure to finish
before proceding?
Thanks
Charles