ExecuteDataSet: TableName is not given...

Topics: Data Access Application Block
Sep 3, 2007 at 8:15 AM
Edited Sep 3, 2007 at 8:17 AM
Hi,

I'm testing the Enterprise Library with MySQL.

If I make a query and get a DataSet, the DataTable in the DataSet has not the name of the table given in the query. It has just "Table" in it.

Example:

I do a query like "SELECT * FROM foo" and get TableName = "Table" and not TableName = "foo".

Why? Is this a bug or purpose?

Thank you very much in advance.
Sep 3, 2007 at 2:38 PM
Hi,

You will get this generic "Table" if you use the ExecuteDataSet methods. However if you use the LoadDataSet methods, and you supply the DataSet, you can specify the names you want to use for the tables. Keep in mind that the result of a query is usually not just all the data from a table, so no attempt to determine the name of the table is made and that's why it defaults to "Table".

You can read more about ADO.NET's table mappings here http://msdn2.microsoft.com/en-US/library/byt00a0h(VS.71).aspx.

Regards,
Fernando