Mapping oledb data to odbc target

  • Thread starter Josef Schneider
  • Start date
J

Josef Schneider

Given: Data.oledb source, and a Data.odbc target

The oledb data is read into a dataset.

(1)

Is there an easy way to copy that dataset to the target datasource ( I
can look through the dataset and do INSERT statements, but is there a
single command to copy the data to a table ) ?

(2)

Is there a dataset object for odbc ?

(3)

Does .net have a native ado.net interface to as/400/db2 databases?
 
S

Sahil Malik

Is there an easy way to copy that dataset to the target datasource ( I
can look through the dataset and do INSERT statements, but is there a
single command to copy the data to a table ) ?

If you're talking One Sql Statement ---
<--- You'll need to write the oneshot command as the actual database
underlying the ODBC provider could be god knows what. Even then very few
databases support the ability to persist everything from a datatable like
structure into tables - Sql Server does - XML DML

Now if you're looking for a one shot command as far as your C# code goes

Create a new DataTable,
DataTable.ImportRow (From the other datatable in a loop)
DataAdapter.Update(thisnewDatatable)

<--- remember the above will use COmmandBuilder to generate your Sql - so it
won't be pretty and won't work in every single case on the planet (i.e. if
there are PK's missing or weird joins ).

(2)

Is there a dataset object for odbc ?
Yes, System.Data.DataSet is not for a provider, it's common all over.
(3)

Does .net have a native ado.net interface to as/400/db2 databases?
.... I think for Db2 it does, but I really don't know :-/// !! But there are
many other ultra smart folks on this group who will know for sure. How 'bout
google? :)


- Sahil Malik
http://dotnetjunkies.com/weblog/sahilmalik
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top