Thursday, December 29, 2005 2:55:58 PM UTC :: Filed Under ASP.NET

Note to self:  Do not add a reference to the assembly System.Data.SqlClient in a VisualStudio.NET 2005 project, it is only necessary to have a reference to System.Data.  If you reference both assemblies, you get this error in VisualStudio:

'SqlConnection' is ambiguous in the namespace 'System.Data.SqlClient'.

Why does this happen? According to Kevin Yu’s response in the Google microsoft.public.dotnet.framework newsgroup:

“The System.Data.SqlClient assembly under the PublicAssemblies is used by VS.NET IDE internally. It is a party of the IDE and only the product team knows the difference between this and the one under GAC.

This System.DataSqlClient is not intended to be called from the user code. Usage of this assembly is not supported and might lead to unexpected results.

So if you need to connect to SQL Server in your code. Please reference the System.Data assembly under GAC as MSDN refers to. It includes the namespace of System.Data.SqlClient.”

Navigation
On this page....
Search
Archives
<December 2005>
SunMonTueWedThuFriSat
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567
Categories
Contact me
Send mail to the author(s) Contact Todd M. Taylor