how to get database table name for each field in datatable
I know how to get the name of a field within a
How do I get the database Table name (not the
2 Solutions collect form web for “how to get database table name for each field in datatable”
The database table name is not returned in the
DataTable. You should know the table name from the select statement (if a proc, look at the proc code) you used to populate the
DataTable is a table in memory. It does not keep track of from which database table it got filled.
Suppose I am using this select statement to fill a DataTable
select * from foo,bar where foo.id = bar.id
Now tell me what should be DataTable name.
What you can do is when filling datatable, give it a table name like this
mydatatable = new DataTable("SomeTableName");