DataTable.TableName returns "Table"??

  • Thread starter Thread starter Antonio Ooi
  • Start date Start date
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
 
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.
 
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.
 
MyDataAdapter.TableMappings.Add("Table", "NameIWishToUseForTable");

---

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

***************************
Think Outside the Box!
***************************
 
Back
Top