Re: Copy data between two dataadapters by Thomas
Thomas
Fri May 14 06:21:51 CDT 2004
Jonathan,
yes, that's no problem...
We just changed our application to read the source record by record... This
gives us a better performance on big recordsets...
Thanks,
Thomas
"Jonathan Levine" <jonathan.levine@gmail.com> schrieb im Newsbeitrag
news:df5434c9.0405132017.53f0bfea@posting.google.com...
> Thomas,
>
> Does your source dataset support SELECT TOP n and ORDER BY on the
primary key?
>
> -- J
>
> "Thomas Pagel" <tpagel@software4you.no-spam.com> wrote in message
news:<#c7jWjLOEHA.3264@tk2msftngp13.phx.gbl>...
> > Jonathan,
> >
> > we would be happy if we would have an ID... We have a primary key, but
it's
> > a string...
> >
> > Thanks,
> >
> >
> > Thomas
> >
> > "Jonathan Levine" <jonathan.levine@gmail.com> schrieb im Newsbeitrag
> > news:df5434c9.0405122138.135e7e1b@posting.google.com...
> > > Thomas,
> > >
> > > If you have an indexed ID column in your table, I'd recommend
> > > rewriting the SELECT on your source dataadapter to include WHERE id >
> > > @minrecord AND id <= @maxrecord.
> > >
> > > When before executing your dataadapter.fill, call
> > >
> > > dataadapter.selectcommand.parameters("@minrecord").Value = 0
> > > dataadapter.selectcommand.parameters("@maxrecord").Value = 1000
> > >
> > > The next time through, increment them by 1000, and so on.
> > >
> > > Good luck,
> > >
> > > Jonathan
> > >
> > > "Thomas Pagel" <tpagel@software4you.no-spam.com> wrote in message
> > news:<#3fwq2DOEHA.620@TK2MSFTNGP10.phx.gbl>...
> > > > Hi,
> > > >
> > > > we want to build an application which copies all data from the
source to
> > the
> > > > destination without changing anything.
> > > >
> > > > We use data adapters for this process. So we open both adapters, use
> > "fill"
> > > > on the source and give an "update" to the destination.
> > > >
> > > > The problem is that the table we want to copy is quite large. So we
see
> > > > quite a memory usage. So we decided to move the data in blocks, 1000
> > records
> > > > at a time. We use the dataadpter.fill(dataset,0,1000,tablename) to
read
> > the
> > > > first records, then we do an update, then the next fill
> > > > (dataadpater.fill(dataset,1001,2000,tablename) and loop that till
EOF.
> > > >
> > > > We see that the programm moves the first records quite quickly but
gets
> > > > slower and slower over time. Our idea is that the dataadapter take
more
> > and
> > > > more time to skip the first records of the source to get to the real
> > > > "payload".
> > > >
> > > > Is there anything we can do better? We simply want to move the first
> > 1000
> > > > records, then the next 1000, and so on...
> > > >
> > > > Thanks,
> > > >
> > > >
> > > >
> > > > Thomas