Re: Read from one, write into another data source
- From: "news.microsoft.com" <billva@xxxxxxxxxxxxxxx>
- Date: Mon, 30 May 2005 15:18:47 -0700
Again, this sounds like you're using ADO to to transport (bulk copy) data.
ADO is a query interface, not particularly suitable as a bulk copy engine.
Use BCP or DTS for this.
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
"Maxime LABELLE" <MaximeLABELLE@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:8B059CF4-FEDF-45FF-BE43-C0D3F8D09250@xxxxxxxxxxxxxxxx
> Hi,
>
> I'm trying to read data from a datasource in a DataSet, and write the
> contents into another DataSource.
>
> I have succeeded in using an OleDbDataAdapter to select, update, insert
> and
> delete records from one datasource automatically (via its SelectCommand,
> UpdateCommand, InsertCommand and DeleteCommand properties).
>
> However, I would like the insert, update and delete done against a
> different
> datasource than that of the select. The problem I face is that I don't
> know
> how to instruct the dataset to alter the RowState of its rows based on the
> contents of the destination datasource.
>
> I have tried something like this:
>
> adapter.InsertCommand.Connection = another_connection;
>
> // save current connection
> OleDbConnection connection = adapter.SelectCommand.Connection;
> // change connection
> adapter.SelectCommand.Connection = another_connection;
> // fill from alternate data source (refresh the row states ?)
> adapter.Fill(dataset_);
> // restore original connection
> adapter.SelectCommand.Connection = connection;
>
> But that fails to refresh the row states. I would expect that each row in
> the dataset that do not correspond to one row in the alternate datasource
> to
> be modified to "INSERTED", but that does not appear to be the case.
>
> Is there a simpler way to achieve this? Do I need to create another,
> similar, DataSet in which I manually add rows from the initial DataSet?
>
> Thanks for your time.
>
.
- Follow-Ups:
- Re: Read from one, write into another data source
- From: Stephen Howe
- Re: Read from one, write into another data source
- From: Maxime LABELLE
- Re: Read from one, write into another data source
- References:
- Read from one, write into another data source
- From: Maxime LABELLE
- Read from one, write into another data source
- Prev by Date: Re: Connection object question
- Next by Date: Re: ADO from DAO
- Previous by thread: Read from one, write into another data source
- Next by thread: Re: Read from one, write into another data source
- Index(es):
Relevant Pages
|
|