Link to home
Start Free TrialLog in
Avatar of Declan Basile
Declan BasileFlag for United States of America

asked on

Class name ambiguous in NameSpace

I'm using Visual Studio 2015.  I wanted to drag and drop OleDataAdapter from the data section of WebForm designer and didn't find it, so I Installed the System.Data.OleDb namespace using Nuget (From Console typed Install-Package ...).  Now I still don't see it in the data section of WebForm designer, and when I try to add it manually in code (System.Data.OleDb.OleDbDataAdapter) I get an "ambiguous in namespace" error.  Is this because I now have two versions of this namespace?  I tried to uninstall the namespace in NuGet and still get the error.  I also looked at the list of references and only saw the namespace listed once.  Most importantly, how can I fix this error?  and Secondly, how do I get OleDataAdapter to show up under the data section in WebForm designer?
Avatar of Misha
Misha
Flag of Russian Federation image

Check, that System.Data.OleDb.dll library is in your project references.
Try to fully qualify the name of  OleDbDataAdapter in your code.
Avatar of Declan Basile

ASKER

I did fully qualify the name as "System.Data.OleDb.OleDbDataAdapter".  This reference was listed once in project references as version 5.  Almost all of the other references were listed as version 4.  I think I had both version 4 and version 5 of the System.Data.OleDb namespace and the program didn't know which version to use.  I deleted the version 5 reference (the only one I saw listed).  Now I don't see any reference at all to "System.Data.OleDb", yet the program works fine without an error now.  Any additional information about what happened, why references didn't list both versions and is now not listing either version, and why OleDb objects are still not available to select in WebForm designer would be appreciated.  Whether I get any information explaining any of this or not, I'll close out the question because the program is working now.  Thank you.
ASKER CERTIFIED SOLUTION
Avatar of Declan Basile
Declan Basile
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial