Improve the Alog (Datatable & SP)

  • Thread starter Thread starter Agnes
  • Start date Start date
A

Agnes

I had a temp table, I need to pass each invno to a SP to process an update
command .
Now, My client complaint the following process is too slow and take many
times. I really got no idea to improve it.
Can SP recieve a temp table ? or receive a arraylist to process ???
Thanks

Dim dvTempDetail As New DataView(dtTempDetail)
dtTempDetail.DefaultView.Sort = "voucherno"
dvTempDetail.RowFilter = "voucherno='" &
Me.txtVoucherNo.Text.Trim & "' "

For Each dvRow In dvTempDetail
cmdUpdate.Parameters.Clear()
With cmdUpdate
.CommandText = "dbo.Update_arap_rvpv_reverse"
.Parameters.Add(New SqlParameter("@invno",
SqlDbType.Char)).Value = dvRow.Item("docno")
.ExecuteNonQuery()
End With
Next
'----Save -----
 
It would be hard to say what to do without the dbo.Update_arap_rvpv_reverse
stored procedure to see what it does and without knowing how many records
you are attempting to update.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top