Solved

VB.net Imported Name spaces

Posted on 2012-03-11
2
221 Views
Last Modified: 2012-03-11
Hi

I am using third party software in Visual Studio and notice that although I have added references to their software that the relevant items are not ticked in the import name spaces at the bottom of the project references window. Should I check these boxes? Will it make it easier to use and how?
0
Comment
Question by:Murray Brown
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 37707599
Importing a namespace means you don't have to "fully qualify" the type name within your code. For example whereas you can type this in your code:

System.Console.WriteLine("Hello World!")

Open in new window


Do you really want to type "System" every time you want to write to the console? Instead, we often do:

Imports System

...

Console.WriteLine("Hello World!")

Open in new window


This may seem trivial for this example, but when you start getting into deeper namespaces, then the savings becomes apparent (e.g. System.Collections.Generic).

As far as checking the boxes, that is up to you. You can either check the boxes, or you can put the "Imports" statement within each file that uses something from that namespace. I believe if you check the boxes, then the imports are application-wide, whereas putting them within each file makes the import applicable just to that file.
0
 

Author Closing Comment

by:Murray Brown
ID: 37707684
thanks very much
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question