问题
I'm using gridview on my webform and I want to export data from SQL server to excel using asp.net c#, and I'm using ClosedXML.Excel but the error is
The type or namespace name 'ClosedXML' could not be found (are you missing a using directive or an assembly reference?)
How could I remove this?
回答1:
It because you have not installed the package therefore you don't have the appropriate DLLs. Due to not having the DLLs you are receiving this error. Firstly you will need to install the package using NuGet as mentioned here and then reference it accordingly. To install the package just do
Install-Package ClosedXML
Once you have installed the package just do
using ClosedXML;
来源:https://stackoverflow.com/questions/27507242/what-should-i-do-for-working-with-closedxml-correctly-in-asp-net