Populate each column of a datatable from a different oledbprovider

M

Mahesha

Hello,
Is it possible in ADO.NET to populate each column of a datatable from
a different oleDBprovider. I mean, if I define a datatable with 5
columns.
First column should be populated from a sybase data source. Second
from a SQL server , third from a XML file.
Also based on the data populated in this way, I need to make 4th and
5th columns as calculated columns based on data in first three
columns.

The data for 4th column should be something like this:
Round(ColData_1,2) + (ColData_2-ColData_3)/2

Any help on this would be great..
Thanks
-Mahesha
 
R

Rebecca Riordan

Probably, but if you're only retrieving a single column, how do you know
which column goes with which?

--
Rebecca Riordan, MVP

Designing Relational Database Systems
Microsoft SQL Server 2000 Programming Step by Step
Microsoft ADO.NET Step by Step

http://www.microsoft.com/mspress

Blessed are they who can laugh at themselves,
for they shall never cease to be amused...
 
C

Chayapathi Mahesha

Hi Rebecca,
The columns are related to each other based on a date field which is the
primary key and has a 1-1 mapping with each of the data source tables.
Thanks
-Mahesha
 
R

Rebecca Riordan

Okay, now I'm with you.

You can use the TableMappings collection of the DataAdapter to map each
column in the source to a column in the dataset, and you can certainly have
multiple data adapters associated with the dataset, but unless you only ever
have a single row, you're going to need to include the coordinating column,
which looks like the date field.

HTH

--
Rebecca Riordan, MVP

Designing Relational Database Systems
Microsoft SQL Server 2000 Programming Step by Step
Microsoft ADO.NET Step by Step

http://www.microsoft.com/mspress

Blessed are they who can laugh at themselves,
for they shall never cease to be amused...
 
M

Mahesha

Hi Rebecca,

Thanks for your response and it helped a lot.
However it seems I cant use any math functions with
datacolumn.expression .
Once I consolidate the data fields from different data sources in to
one data table I need to add additional columns which are quite
complex math expressions based on other fields.
Any alternate suggestions?

Thanks
-Mahesha
 

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