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
---------------------------

thank U for Help and excuse me for my bad english.

RE: Problem wiht ado net 2.0 by KerryMoorman

KerryMoorman
Tue Jun 17 17:30:00 CDT 2008

v@nb@asten4eveR99,

ADO.Net is not a particularly good choice for rapidly adding 100000 rows to
a table.

Kerry Moorman


"v@nb@asten4eveR99" wrote:

> 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
> ---------------------------
>
> thank U for Help and excuse me for my bad english.
>

Re: Problem wiht ado net 2.0 by v

v
Tue Jun 17 17:46:57 CDT 2008

Kerry Moorman ha scritto:
> v@nb@asten4eveR99,
>
> ADO.Net is not a particularly good choice for rapidly adding 100000 rows to
> a table.
>
> Kerry Moorman

OK well, and what is a good choice for insert a lot o data in the
shortest time?
I've to read a lot of a data from a access DB, modify this data and put
it into a SQL server 2005 DB. What is the best choice I can do?

Thanks again, and excuse me for my bad english :-)

>
>
> "v@nb@asten4eveR99" wrote:
>
>> 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
>> ---------------------------
>>
>> thank U for Help and excuse me for my bad english.
>>

Re: Problem wiht ado net 2.0 by KerryMoorman

KerryMoorman
Tue Jun 17 18:39:00 CDT 2008

v@nb@asten4eveR99,

The SqlBulkCopy class.

Kerry Moorman


"v@nb@asten4eveR99" wrote:
>
>
> OK well, and what is a good choice for insert a lot o data in the
> shortest time?
> I've to read a lot of a data from a access DB, modify this data and put
> it into a SQL server 2005 DB. What is the best choice I can do?
>
> Thanks again, and excuse me for my bad english :-)
>
> >
> >