Click here to Skip to main content
15,898,035 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
When we have to use a class which in some other namespace we need to add the reference to the corresponding dll file.But sometimes it comes automatically even if we have not added it explicitly.

Example: System.Data.SqlClient.
And in some cases we have to add reference ....like.......System.Data.OracleClient......Why?
Please share if any answer...
Posted
Updated 23-Mar-12 7:56am
v4
Comments
Shahin Khorshidnia 23-Mar-12 13:59pm    
Pease dont type like "WHY?????????????????"
It seems nervous and a little insulting to the experts.
If you say "Why?", the experts can understand you.

The reference to System.Data.Dll is there (was automatically added for you by Visual Studio) you may check that using the Project Properties menu item.
 
Share this answer
 
Comments
Himu from Orissa 23-Mar-12 5:52am    
Why other namespaces dont come only some of them come. i mean why Syste.Data.OracleClient doesnt come like SqlClient
CPallini 23-Mar-12 5:57am    
You have to ask Microsoft. I suspect they are a bit biased towards their own SQL Server. However, to be fair, that is just a default: you may remove that reference.
Ok If it's a serious problem for you:

Visual Studio is a little intelligent and decides about required and most common refrences.
Not to mention the fact that System.Data.SqlClient is comming form an embedded library. But some dll files are user defined!

Of course, you are able to create a project and add all your desired refereces and then export it as Project Template. Thereafter, you can access to the refrences across the VS.
 
Share this answer
 
v5
Comments
Himu from Orissa 23-Mar-12 6:22am    
if u dont mind can u say what is meant by "embeded libraray"........actually i m not a experienced .net programmer....dats why...
Shahin Khorshidnia 23-Mar-12 6:37am    
I mean the System.Data.SqlClient namespace is a part of the System.Data.dll assembly, that is a part of ADO.Net. that is a part of .Net Framework.
Shahin Khorshidnia 23-Mar-12 6:45am    
And Did it help?
Himu from Orissa 23-Mar-12 13:35pm    
then System.Data.OracleClient is part of System.Data or not??????????
Shahin Khorshidnia 23-Mar-12 13:45pm    
All System.Data are parts of ADO.Net. But as I said VS refrenced most common refrences.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900