Thanks Jani Järvinen,
Actualy I am using a data adapter, but that is too slow, because it opens
the connection, writes a record, closes the connection again and that for
every record in the datatable.
What I had in mind is a methode that opens the connection once, dumps the
records in a table very very fast and then clauses the connection again .
Speed is the main issue here. The records actual contains only 1 (sometimes
3) Guid item(s) but there are a lot of them (up to 125.000 records in one
run). So every millisecond counts.
--
RW
"Jani Järvinen [MVP]" wrote:
> Hi RW,
>
> > I write record by record from a datatable into an SQL Server database
> > table.
> > Is there a quicker way to do that than record by record?
>
> Yes, .NET supports doing such things automatically, for example using a
> so-called Data Adapter. For SQL Server, there's a class called
> SqlDataAdapter which has a method called Update, which in turn takes a
> DataTable and then calls the proper INSERT, UPDATE or DELETE statement for
> each modified row in the DataTable.
>
> See the method's documentation on MSDN:
>
> http://msdn.microsoft.com/library/de...dateTopic3.asp
>
> A Visual Basic example is also included.
>
> Good luck!
>
> --
> Regards,
>
> Mr. Jani Järvinen
> C# MVP
> Helsinki, Finland
> (E-Mail Removed)
> http://www.saunalahti.fi/janij/
>
>
>