Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Upendra Pratap ShahiRank #329 · 7.5K reputationPosted Jun 12, 2015, 3:35 AM EDT
Need for Namespaces
Namespaces allow you to create a system to organize your code. A good way to organize your namespaces is via a hierarchical system. You put the more general names at the top of the hierarchy and get more specific as you go down. This hierarchical system can be represented by nested namespaces.By placing code in different sub-namespaces, you can keep your code organized.
Lalit RaghavRank #1,306 · 1.3K reputationPosted Jun 12, 2015, 4:19 AM EDT
Pankaj Kumar ChoudharyRank #80 · 24.4K reputationPosted Jun 12, 2015, 4:32 AM EDT
Julin James25 reputationPosted Jun 18, 2015, 5:31 AM EDT
Julin James25 reputationPosted Jun 18, 2015, 5:34 AM EDT
Hussain PatelRank #1,053 · 1.8K reputationPosted Jun 18, 2015, 7:33 AM EDT
Upendra Pratap ShahiRank #329 · 7.5K reputationPosted Jun 18, 2015, 8:38 PM EDT
Rajeesh MenothRank #118 · 18.4K reputationPosted Jun 18, 2015, 10:31 PM EDT
Nilesh JadavRank #109 · 20.3K reputationPosted Jun 19, 2015, 4:14 AM EDT
Namespace:
Syntax of Namespace :
// Namespace Declaration
Use of Namespace : It is somehow like this, For example if you are making an application on - "Binding A Gridview", surely you will use SQL server Database, so to call the table and your database , you will write code for that in .CS file, at that you have to import namespace: - using system.datausing System;
// The C# Station Namespace
namespace csharp_station
{
// Program start class
class NamespaceCSS
{
// Main begins program execution.
public static void Main()
{
// Write to console
Console.WriteLine("This is the new C# Station Namespace.");
}
}
}
using system.data.SqlClient
By default in.cs file Visual Studio had already imported some namespace for you.
Thank you . Mark Accepted if you satisfy with any answer from any member given below.