c# - Cannot implicitly convert type System.data.datatable to Microsoft.Office.Interop.Excel -
public datatable populatevendorgridview() { dataset ds = new dataset(); ds = (dataset)session["vendorinvoiceid"]; return ds.tables[0]; //getting error here }
a datatable
type exists in both namespaces:
microsoft.office.interop.excel
and
system.data
which imported file.
you have explicitly reference correct namespace return type of populatevendorgridview
:
public system.data.datatable populatevendorgridview() { ...
Comments
Post a Comment