What is "using " keyword doing in "using SQL = System.Data.SqlServer"?

 Posted by Niladri.Biswas on 7/18/2012 | Category: C# Interview questions | Views: 1116 | Points: 40

It's an alias.The user can use SQL to refer to System.Data.SqlServer.
using SQL = System.Data.SqlServer;

SQL.SqlConnection sql = new SQL.SqlConnection();

It's useful if we don't want to use the whole namespace (in case of name clash issues for example).

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response