DataTable.TableName returns "Table"??

A

Antonio Ooi

Hi,

I get a DataTable based on this simple query:
SELECT * FROM Customers

Later, I want to know just the table name because I do not want to play with
the string within the SELECT statement. I expect DataTable.TableName to give
me an exact name, i.e. "Customers", but it gives me "Table" regardless of
what query from what table. Can someone gives me some clarifications on the
TabeName property? Thanks in advance.

Regards,
Antonio
 
P

Peter Rilling

I do not think this has anything to do with the query because suppose you
run the query "select * from Table1, Table2", then what would be the name of
the DataTable? You can set the table name if you want.
 
A

Antonio Ooi

I see, logical. Thanks a lot!

Antonio

Peter Rilling said:
I do not think this has anything to do with the query because suppose you
run the query "select * from Table1, Table2", then what would be the name
of the DataTable? You can set the table name if you want.
 
G

Guest

MyDataAdapter.TableMappings.Add("Table", "NameIWishToUseForTable");

---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 

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