Diff. of SqlClient in System.Data.dll and System.Data.SqlClient.dl

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I notice that if you have VS.NET 2005 installed, you will find in the .NET
references when adding a reference:
System.Data.SqlClient.Dll in
"Microsoft Visual Studio
8\Common7\IDE\PublicAssemblies\System.Data.SqlClient.dll"
3.0.3600.0

However you also find System.Data.SqlClient being part of
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll"
2.0.0.0

Can someone point me to some documentation, what the actual differences are
and what we should do with it?


Regards,
 
Hi,

There is a readme.txt file under PublicAssemblies folder which tells us
what are these assemblies do.

The PublicAssemblies folder is designed to contain managed assemblies that
run within the development environment and are typically called from
macros, add-ins, and other user code. The assemblies in this directory are
displayed in the Project Add References dialog box and the Object Browser's
Component Selector dialog box. For example, COM interoperability wrappers
for automation object models (e.g. vslangproj.dll) should be installed in
the PublicAssemblies folder.

Assemblies that are not intended to be called from user code should be
installed into the PrivateAssemblies folder.

The System.Data.SqlClient.dll under this folder is not the one we call from
our code to connect to SQL servers.

The System.Data.SqlClient in System.Data.dll is the one we are using in our
code. In the Microsoft.NET folder, it is just a copy. The one we're
actually calling in the GAC under c:\Windows\assembly

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Hi Kevin,

thanks, however it did not answer what the difference
between
System.Data.SqlClient
System.Data.SqlClient.dll in PublicAssemblies
and System.Data.dll
really is. I mean "in detail".
(I did not ask for an explanation of the PublicAssemblies-folder here).

Do not forget that "in my code" I can force to use a type defined in a
specific dll and even though it is the normal case to use the GAC-installed
version, I technically still can choose to do otherwise.

So:
What does it do different if I use in my code use System.Data.SqlClient of
System.Data.SqlClient.dll in contrast to System.Data.SqlClient in
System.Data.dll?


Thanks,
 
Hi,

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.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Back
Top