471,344 Members | 1,389 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,344 software developers and data experts.

DataTable.TableName returns "Table"??

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
Jul 21 '05 #1
3 5121
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.

"Antonio Ooi" <an*******@homail.com> wrote in message
news:ex**************@TK2MSFTNGP10.phx.gbl...
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

Jul 21 '05 #2
I see, logical. Thanks a lot!

Antonio

"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
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.

"Antonio Ooi" <an*******@homail.com> wrote in message
news:ex**************@TK2MSFTNGP10.phx.gbl...
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


Jul 21 '05 #3
MyDataAdapter.TableMappings.Add("Table", "NameIWishToUseForTable");

---

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

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

"Antonio Ooi" wrote:
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

Jul 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Alanoly J. Andrews | last post: by
4 posts views Thread by Saso Zagoranski | last post: by
3 posts views Thread by Antonio Ooi | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.