Re: Read from one, write into another data source



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


.



Relevant Pages

  • Re: DriverManager vs. DataSource?
    ... > class to establish the connection. ... it is possible to use the DriverManager interface. ... JDBC driver jars go in a 'common' directory in the container. ... > the DataSource interface will typically be registered with a JNDI ...
    (comp.lang.java.databases)
  • Re: Connection for Data Source in SSAS 2005 Tutorial Lesson 6
    ... double click on the datasource and then click on ... I noticed that my server explorer showed a connection to ... When connecting to SQL Server 2005, this failure may be caused by the ... not be made to the data source with the DataSourceID of 'Adventure ...
    (microsoft.public.sqlserver.olap)
  • Re: Need ODBC Jump Start
    ... Depends on what you need exactly and how good you know ADO ... any visual components that will show data, and i would suggest to use a ... TADODataset and Datasource. ...
    (borland.public.delphi.database.ado)
  • Re: ConnectionPoolDataSource + MM MySQL + Tomcat4
    ... to work with Tomcat 5.0.28 and MySQL or Oracle. ... <ResourceParams> ... in functions needing DB access, use the DataSource variable ... to create a Connection ...
    (comp.lang.java.programmer)
  • Re: Datagrid help, please
    ... Drop a grid on the form and specify it's datasource ... connection string in advance you can set it in the ... > I am working to converta Delphi application to a C# Winform application. ...
    (microsoft.public.dotnet.languages.csharp)