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

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -