Problem with ADO net 2.0

A

a.marmugi

I'have a problem. Ado net 2.0 is resulting very slowly. I'vemade a
test in which i write 100000 record in a database with VB6 Dao and
with VB2005 ADO net 2.0. In the first case the time elapsed for the
operation is 2 second, in the second case the time elapsed is 2
minutes. Can anyone help me to find where i wrong (if i wrong
something...).

in particulary the most part of the time is used for complete the
Update method.

The vb2005 code tha i've use for the test is this:

----------------------------
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Me.Label1.Text = Now
Dim ds As New dbprovaDataSet
Dim tab As dbprovaDataSet.tabella1DataTable = ds.tabella1
Dim riga As dbprovaDataSet.tabella1Row

Dim i As Integer = 0

For i = 1 To 100000
riga = tab.Newtabella1Row
riga.campo = i
tab.Addtabella1Row(riga)
Next
Me.Label2.Text = Now
adap.Update(tab)
Me.Label3.Text = Now
MsgBox("fine")

End Sub
 
C

Cor Ligthert[MVP]

Hi,

With telling that DAO in this kind of operations is quicker you are telling
nothing new.

Why not try that procedure in the same situation where 1000 users are
inserting at the same time and see what is then the effect.

As I assume that is not your problem, why then not try to use bulkcopy in
this procedure?

http://msdn.microsoft.com/en-us/library/1y8tb169.aspx

Cor
 
M

Michel Posseth [MCP]

I'have a problem. Ado net 2.0 is resulting very slowly. I'vemade a
test in which i write 100000 record in a database with VB6 Dao and
with VB2005 ADO net 2.0. In the first case the time elapsed for the
operation is 2 second, in the second case the time elapsed is 2
minutes. Can anyone help me to find where i wrong (if i wrong
something...).

in particulary the most part of the time is used for complete the
Update method.

The vb2005 code tha i've use for the test is this:

----------------------------
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Me.Label1.Text = Now
Dim ds As New dbprovaDataSet
Dim tab As dbprovaDataSet.tabella1DataTable = ds.tabella1
Dim riga As dbprovaDataSet.tabella1Row

Dim i As Integer = 0

For i = 1 To 100000
riga = tab.Newtabella1Row
riga.campo = i
tab.Addtabella1Row(riga)
Next
Me.Label2.Text = Now
adap.Update(tab)
Me.Label3.Text = Now
MsgBox("fine")

End Sub

And if you want to make it even quicker you use VB6 instead of VB.Net ,, as
DAO and VB6 are native to each other this is unbeatable in speed
however now ditch ACCES and do the same test with a SQL server series
database as this is native to .Net

A good replacement for Access in a .Net app would be SQLCE

regards

Michel .
 

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