Ambiguous Namespace

TechGnome

Well-known member
Joined
May 23, 2005
Messages
896
Programming Experience
10+
Has any one ever come across the following error?

Error from VS2005 IDE said:
Error 1 'SqlConnection' is ambiguous in the namespace 'System.Data.SqlClient'. ...\Projects\WindowsApplication2\WindowsApplication2\Form1.vb 3 19 WindowsApplication2

Something recently changed on my machine that has caused the above errors when I reference SQLClient in a project. If I don't add the reference, then I can import it and use the SQL Client just fine. It's like there's a hidden reference to it somewhere. Even in a fresh/new application. But once I add the reference, I get the Ambiguous error. Quite frankly it's starting to tick me off.

I'd rather not have to reinstall VS2005, but I will if I have to.

1) Has anyone seen this before?
2) Does any one know of a cure for it?

-tg
 
I did a little digging after I posted.... and here's what I found. There really is TWO different SQLClient classes. One is found within the System.Data itself. This is the one that I've been inherently using. However, there's another System.Data.SQLClient.DLL file in the VS global assemblies folder.

If I reference the System.Data.SQLClient.dll, then in the object browser, I can see system.data.sqlclient, and when I click on it, I get this:
Assembly System.Data.SqlClient
C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PublicAssemblies\System.Data.SqlClient.dll

When I expand the System.Data namespace, then click on the SQLClient in there, I get this:
Namespace System.Data.SqlClient
Member of: System.Data
Summary:
The System.Data.SqlClient namespace is the.NET Framework Data Provider for SQL Server.

And if I expand the two SQLClient nodes, I get two different sets of members. Ah-Ha! Said my mind when I see this. It seems this is the source of my problem. The DLL one has the stuff I need in order for my O/R Mapper to work, but when included, it doesn't work.

I've posted this on the O/R Mapper's forums.... hopefuly something will shake lose from it. Sux really, I am not looking forward to having to build my classes by hand.

-tg
 
Found m problem... it was a table structure issue.... I'll be fixing it tonight.

-tg
 
Back
Top