Getting the column and table name from an SQLDataReader.

  • Thread starter Thread starter Antonio Bruno
  • Start date Start date
A

Antonio Bruno

Hi,

Is it possible, using the SQLDataReader, to know for each
column, not only the name of the column but also the name
of the corresponding table?

With the GetName method I've only been able to get the
column name. Tried GetSchemaTable, but unfortunatly,
fields like "GetTableName" return empty(?).

For example, if I use a DataReader on the following query:

use northwind
select customers.customerid, orders.customerid from
customers, orders where
orders.customerid=customers.customerid

I would like the be able to
distinguish "customers.customerid"
from "orders.customerid", out of my SQLDataReader results.

I'll also be using DataSets, is the solution ( if any )
equal for both classes?

I'm using .NET 1.0, SQL Server 2000; and the Data Access
Application Block.

Thanks.
 
Back
Top