Namespaces Tonga Institute of Higher Education. Introduction to Namespaces The.Net Framework provides many classes for doing different things  File Input/Output.

Slides:



Advertisements
Similar presentations
NAMESPACES AND VISUAL INHERITANCE. OBJECTIVES In this chapter, I will cover the following: Using namespaces Visual inheritance.
Advertisements

Programming with Objects: Class Libraries and Reusable Code.
The Microsoft View: Module 1: Getting Started. Copyright Course 2559B, Introduction to Visual Basic®.NET Programming with Microsoft®.NET. Lecture 1 Microsoft.
Introduction to the C# Programming Language for the VB Programmer.
Chapter 3: Introducing the Microsoft.NET Framework and Visual Basic.NET Visual Basic.NET Programming: From Problem Analysis to Program Design.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Chapter 14: Advanced Topics: DBMS, SQL, and ASP.NET
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
Visual Studio: Custom debugger visualizers. Creating Debugger Visualizers with Visual Studio : Introduction Code debugging is one of the most important.
1 Chapter 20 — Creating Web Projects Microsoft Visual Basic.NET, Introduction to Programming.
Creating and Running Your First C# Program Svetlin Nakov Telerik Corporation
Tahir Nawaz Visual Programming C# Week 2. What is C#? C# (pronounced "C sharp") is an object- oriented language that is used to build applications for.
Working with SharePoint Document Libraries. What are document libraries? Document libraries are collections of files that you can share with team members.
11.1 © 2004 Pearson Education, Inc. Exam Managing and Maintaining a Microsoft® Windows® Server 2003 Environment Lesson 11: Introducing WINS, DNS,
2. Introduction to the Visual Studio.NET IDE 2. Introduction to the Visual Studio.NET IDE Ch2 – Deitel’s Book.
McGraw-Hill© 2007 The McGraw-Hill Companies, Inc. All rights reserved. 1-1.
Hands-on Introduction to Visual Basic.NET Programming Right from the Start with Visual Basic.NET 1/e 6.
Introduction to VB.NET Tonga Institute of Higher Education.
© 2004 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Programming the Web Using ASP.Net Chapter 2: The ASP.Net Template Dave.
1 Working with MS SQL Server. 2 Objectives You will be able to Use Visual Studio for GUI based interactive access to a Microsoft SQL Server database.
Lecture Roger Sutton CO530 Automation Tools 5: Class Libraries and Assemblies 1.
1 Introduction to.NET Framework. 2.NETFramework Internet COM+ Orchestration Orchestration Windows.NET Enterprise ServersBuildingBlockServices Visual Studio.NET.
Visual Basic: An Object Oriented Approach 12 – Creating and using ActiveX objects.
M1G Introduction to Programming 2 4. Enhancing a class:Room.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
ASP.NET The.NET Framework. The.NET Framework is Microsoft’s distributed run-time environment for creating, deploying, and using applications over the.
Architecture of.NET Framework .NET Framework ٭ Microsoft.NET (pronounced “dot net”) is a software component that runs on the Windows operating.
Microsoft Visual Basic 2005: Reloaded Second Edition
Creating and Running Your First C# Program Svetlin Nakov Telerik Corporation
Importing outside DLLs into.Net platform and using them By Anupama Atmakur.
CIS 375—Web App Dev II Microsoft’s.NET. 2 Introduction to.NET Steve Ballmer (January 2000): Steve Ballmer "Delivering an Internet-based platform of Next.
Assemblies & Namespaces1. 2 Assemblies (1).NET applications are represented by an assembly An assembly is a collection of all software of which the application.
IT 211 Project Integration and Deployment Lab #11.
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
Lecture 1 Programming in C# Introducing C# Writing a C# Program.
Tutorial 121 Creating a New Web Forms Page You will find that creating Web Forms is similar to creating traditional Windows applications in Visual Basic.
2. Introduction to the Visual Studio.NET IDE. Chapter Outline Overview of the Visual Studio.NET IDE Overview of the Visual Studio.NET IDE Menu Bar and.
11 Web Services. 22 Objectives You will be able to Say what a web service is. Write and deploy a simple web service. Test a simple web service. Write.
Lecture Set 2 Part B – Configuring Visual Studio; Configuration Options and The Help System (scan quickly for future reference)
Tutorial 111 The Visual Studio.NET Environment The major differences between Visual Basic 6.0 and Visual Basic.NET are the latter’s support for true object-oriented.
© BJSS Limited 2005 Commercial in Confidence Visual Studio 2008 Productivity Enhancing Tips and Resources Jeff Watkins – 25 September 2008.
Lecture Set 1 Part C: Understanding Visual Studio and.NET – Applications, Solutions, Projects (no longer used – embedded in Lecture Set 2A)
1 Working with MS SQL Server Textbook Chapter 14.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 Working with MSSQL Server Code:G0-C# Version: 1.0 Author: Pham Trung Hai CTD.
Tutorial 1: An Introduction to Visual Basic.NET1 Tutorial 1 An Introduction to Visual Basic.NET.
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files.
Working With Objects Tonga Institute of Higher Education.
1.NET Web Forms Visual Studio © 2002 by Jerry Post.
Visual Basic.NET BASICS Lesson 1 A First Look at Microsoft Visual Basic.NET.
XML Web Service. Overview of XML Web Service ASP.NET XML Web services enable you to remotely access the properties and methods of classes across a network.
Module 1: Getting Started. Introduction to.NET and the.NET Framework Exploring Visual Studio.NET Creating a Windows Application Project Overview Use Visual.
1 Introduction to C# Programming Console applications No visual components Only text output Two types MS-DOS prompt - Used in Windows 95/98/ME Command.
1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.
Compunet Corporation1 Programming with Visual Basic.NET Fundamentals of Programming Lecture # 1 Tariq Ibn Aziz.
Hands-on Introduction to Visual Basic.NET Programming Right from the Start with Visual Basic.NET 1/e 6.
Getting Started with.NET Getting Started with.NET/Lesson 1/Slide 1 of 31 Objectives In this lesson, you will learn to: *Identify the components of the.NET.
Object-Oriented Application Development Using VB.NET 1 Chapter 2 The Visual Studio.NET Development Environment.
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files 8/10/ :35 PM.
Text Introduction to.NET Framework. CONFIDENTIAL Agenda .NET Training – Purpose  What is.NET?  Why.NET?  Advantages  Architecture  Components: CLR,
Building Custom Controls with ASP.NET and the Microsoft ®.NET Framework Rames Gantanant Microsoft Regional Director, Thailand
Working with ASP.NET Controls What is ASP.NET Using server controls in your pages Allowing users to create their own accounts Creating a login page Letting.
Database (Microsoft Access). Database A database is an organized collection of related data about a specific topic or purpose. Examples of databases include:
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
D OTNET ONLINE TRAINING. DOTNET Online Training Course Content : Introduction to.Net Online Training NET FUNDAMENTALS Why Dot Net? The Dot Net initiative.
Visual Basic 2010 How to Program
Chapter 2: The Visual Studio .NET Development Environment
Social Media And Global Computing Using DLLs with MVC
Social Media And Global Computing Creating DLLs with Visual Studio
Tonga Institute of Higher Education
Tutorial 7 – Integrating Access With the Web and With Other Programs
Presentation transcript:

Namespaces Tonga Institute of Higher Education

Introduction to Namespaces The.Net Framework provides many classes for doing different things  File Input/Output  Displaying Windows  Database Connectivity  Etc. Microsoft needed a way to organize the classes. They decided to use namespaces. It is like the address of a class.NET Framework Class Library – The entire collection of classes Microsoft made for.NET organized by namespaces

Namespace Fundamentals Namespaces organize the objects defined in an assembly Assemblies – Primary unit of deployment for.NET Applications  Dynamic Link Library (.DLL)  Executable (.EXE) Assemblies can contain multiple namespaces, which can in turn contain other namespaces Namespaces prevent ambiguity and simplify references when using class libraries

Namespace Structure Namespaces are arranged hierarchically. Each namespace has a position above or below another namespace You can have namespaces inside of namespaces System Math DecoderStringBuilder Encoder Data Operating System DataRow Text Class Contains Classes

System Math DecoderStringBuilder Encoder Data Operating System DataRow Text Namespace Names The name of a namespace is actually a list of names separated by periods. System.Data.DataRow System.Text.StringBuilder System.Text

Using Namespaces If you want to use a built-in.NET class, first look it up in the Microsoft Developer Network Library (MSDN) The MSDN Library is installed on your computer  Start -> Microsoft Developer Network -> MSDN Library for Visual Studio.NET 2003 You can also find it online, but this is slower  If you know the class you want to use, search for that class. Otherwise, search for the.NET Framework Class Library Reference

Demonstration.NET Framework Class Library Resources

Imports Statements 1 To use a class you must tell Visual Studio.NET where to find it. 1. Use the fully qualified namespace (The full name) Dim x As System.Text.StringBuilder 2. Use an imports statement Imports System.Text Dim x As StringBuilder System Math DecoderStringBuilder Encoder Data Operating System DataRow Text

Imports Statements 2 Typing a fully qualified namespace is a lot of work The Imports statement makes this easier The namespace that contains the class you use Does not need to be the full name

Demonstration Using Import Statements

Import Defaults Visual Basic.NET automatically imports a few namespaces To see these: Solution Explorer -> Project -> Right Click -> Properties -> Common Properties -> Imports

Demonstration Import Defaults

References Namespaces organize the objects defined in an assembly Assemblies – Primary unit of deployment for.NET Applications  There are 2 kinds: Dynamic Link Library (.DLL) Executable (.EXE) Each project has a list of standard assemblies it references If you want to use a class inside an assembly that is not automatically included, you must add it To add a reference to an assembly:  Solution Explorer -> Project Name -> References -> Right Click -> Add Reference  Select an assembly from the list or browse for the assembly Standard assembly references

Demonstration Default References and Adding References

Creating a NameSpace If we write code and share it with others we can use a namespace to organize our code Others will import the namespace we created to use our code in their program

Creating a NameSpace If you want to make your own namespace to be used in other programs, define it.  Solution Explorer -> Project Name -> Right Click -> Properties -> Common Properties -> General -> Root Namespace

Demonstration Creating a Namespace