Reputation: 62534
i try to work with SqlConnection in C# (VS2008) , and i get this error:
The type 'System.Data.SqlClient.SqlConnection' exists in both 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll' and 'c:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PublicAssemblies\System.Data.SqlClient.dll' D:\test\DBDB\DBDB\Form1.cs 15 9 DBDB
what it can be ?
Upvotes: 3
Views: 2303
Reputation: 39675
The error message is saying that the exact type you wish to use cannot be determined, because there is a System.Data.SqlClient.SqlConnection
class available in two assemblies referenced by the project.
You probably want to use the class from System.Data.dll, so consider removing any references to System.Data.SqlClient.dll your project may have, and this problem should disappear.
Upvotes: 2
Reputation: 1063704
Perhaps just drop the reference to System.Data.SqlClient.dll
?
Upvotes: 0