update takes long time

G

Guest

Hello,
I have a vb.net web app that I am doing reads and adds to a database.
Everything works fine and happens instantly. I recently added an update and
it takes a long time to finish. I was wondering if there was anyone else who
experenced this problem and if there are any ways around it?

Dim MySQL As String
MySQL = "UPDATE db SET Var1 = 'Y' WHERE aimtno = " & tnum & "
and abook = " & tbook
Dim strConn As String = "Provider=IBMDA400; Data
source=datasource; user id = " & tuserid & "; password = " & tpass & ""
Dim MyConn As New OleDbConnection(strConn)
Dim cmd As New OleDbCommand(MySQL, MyConn)
cmd.Connection.Open()
cmd.ExecuteNonQuery()
MyConn.Close()
 
C

Cor Ligthert

Brian,

Beside Jay there are in my opinion not *much* who have expirience with
connections to an IBM 400 system in this newsgroup in relation with dotNet.

When I was you would I ask this as well in the newsgroup.

Adonet
news://msnews.microsoft.com/microsoft.public.dotnet.framework.adonet

Web interface:
http://communities2.microsoft.com/c.../?dg=microsoft.public.dotnet.framework.adonet

Not that you are not welcome here with your question however to get more
help.

Cor
 
G

Guest

Will do, but I have a 2.8 P4 with a gig of ram. I would think that I would
have enough resources to update one field.

Brian
 
G

Gerald Hernandez

You are asking it to set a field to Y for each record that satisfies 2
values, which could be none up to every record in the database. Maybe it is
updating more records than you are expecting?
Have you looked at the obvious yet, Indexes?
Are the criteria fields indexed? If not, it will search all the records the
hard way looking for which ones to update. This can be painfully slow as you
database gets large.

Gerald
 

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

Top