Reputation: 21
public DataTable populateVendorGridView()
{
DataSet ds = new DataSet();
ds = (DataSet)Session["VendorInvoiceid"];
return ds.Tables[0]; //getting error here
}
Upvotes: 1
Views: 1901
Reputation: 47968
a DataTable
type exists in both namespaces:
Microsoft.Office.Interop.Excel
and
System.Data
which are imported into your file.
You have to explicitly reference the correct namespace for the return type of populateVendorGridView
:
public System.Data.DataTable populateVendorGridView()
{
...
Upvotes: 4