After filling in your dataset with your data adapter, you probably want to transfer that information to a DataTable so that you can display it on a your page’s datagrid, use it in an export to .csv function or something to that nature. However during compile time you may receive the following error:
Non-invocable member ‘System.Data.DataSet.Tables’ cannot be used like a method
One of the reasons you may be receiving this error is due to the way you have the DataTable name enclosed. It should be in brackets instead of parenthesis.
Code Example:
DataTable dtEmployeeList;
return dtEmployeeList = dsEmpTable.Table("Employees");
Instead change the parenthesis to brackets:
DataTable dtEmployeeList;
return dtEmployeeList = dsEmpTable.Table["Employees"];
Since methods headers consist of a method name followed by parenthesis, the compiler will read the first dsEmpTable.Tabe(. . . as an attempt to invoke a method. Once you change it to brackets it should take care of the problem.
