Last post Oct 13, 2013 03:15 AM by Paul Linton
Oct 11, 2013 06:25 AM|insafkpm|LINK
Hai to all
i am trying to generate an excel sheet in my page and while running the page i getting the following error
'Label' is an ambiguous reference between 'System.Web.UI.WebControls.Label' and 'Microsoft.Office.Interop.Excel.Label'
please give your valuable suggestions asap
Oct 11, 2013 06:40 AM|k.panchal|LINK
Place your code snippest here.
Error says that Label is exist in both dll System.Web.UI.WebControls.Label and Microsoft.Office.Interop.Excel.Label.
To distinguish Label you need to use label of Microsoft.Office.Interop.Excel.Label as
Microsoft.Office.Interop.Excel.Label = New Microsoft.Office.Interop.Excel.Label
instead of using that dll in using directives.
Oct 11, 2013 08:21 AM|oned_gk|LINK
Oct 13, 2013 03:15 AM|Paul Linton|LINK
In Visual Studio, with your cursor in the word Label, type ctrl+. (that is the control key and the period or dot). This will pop up a menu which will allow you to choose the particular label you want.
(By the way, regardless of a previous post, the error does not say "exist in both dll" because the problem is not about dlls. It is about choosing the Namespace that Label is part of. People frequently confuse dlls and namespaces)