Can I use this SQL Update faster

  • Thread starter Thread starter Lighting_dragon
  • Start date Start date
L

Lighting_dragon

I Use a loop to update many diferrent Row of a Table as so

For i=0 to Max
Try
MySQLCommand= New OleDbCommand(MySQLStatement, MyConn)
MySQLCommand.ExecuteNonQuery
' (1)***** System.Threading.Thread.Sleep(500)
Catch ex as Expition

End Try

Next

If i don't use Sleep (1)**** it will show an error that dababase is
locked. So I muss use Sleep to wait, but it works too long because I
have over 20 Rows to update.

How can i do that better .
 
* (e-mail address removed)-spam.invalid (Lighting_dragon) scripsit:
I Use a loop to update many diferrent Row of a Table as so

For i=0 to Max
Try
MySQLCommand= New OleDbCommand(MySQLStatement, MyConn)
MySQLCommand.ExecuteNonQuery
' (1)***** System.Threading.Thread.Sleep(500)
Catch ex as Expition

End Try

Next

If i don't use Sleep (1)**** it will show an error that dababase is
locked. So I muss use Sleep to wait, but it works too long because I
have over 20 Rows to update.

.... I suggest to ask this question in a more appropriate group:

<URL:
Web interface:

<URL:http://msdn.microsoft.com/newsgroups/?dg=microsoft.public.dotnet.framework.adonet>
 
Hi Lighting

You can see what this will do for you.
(Playing with it of course)

mySQLCommand.CommandTimeout = 160

I hope this helps?

Cor
 
I have inserted it , but it did'nt work faster. However thank for your
help
 
I have tested yor command. But it didn't work faster. However thank
for your help
 

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