ExecuteDataSet: TableName is not given...

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

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.


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 3:38 PM

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.