query to database

  • Thread starter Thread starter sel
  • Start date Start date
S

sel

hi guys,
could anybody tell me ... why the conextion of with ado.net is slowly? maybe
Idon't used the componets adecudely or maybe I don't do the correct process
to conection of database. when i execute a query the result show 30s
before. my table has about 2000 records. please help me.
 
it's the code in the event keypress on a textbox. when i execute, the result
show about 30sec or more. i like it was fast.

Private Sub TBNOMREP_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles TBNOMREP.KeyPress
cmmsp_find.Parameters.Item("@rep").Value = textbox_rep.Text
conn.Open()
cmmsp_find.ExecuteNonQuery()
SQLCON.Close()
Me.LoadDataSet()
End Sub
 
Hi,

Not really sure what you are trying to accomplish here. You open a
connection, Execute a query which returns no results, then close a different
connection, and finally you call loaddataset. Are you sure the first few
steps are necessary?

Ken
---------------
 
Hi Sel,

In addition to Ken, why do you not make your own simple program where you
have eliminiated all the work in different classes with one class which does
what you want to do, than you can investigate if it goes real slow or that
there are some things that maybe are done to often.

The benefit of that as well is that when it still is not working you can
show it to us and with that we can probably help you.

Just an idea.

Cor
 
Back
Top