Visual Basic.NET
  Home arrow Visual Basic.NET arrow Learning the Visual Basic .NET Language
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
VISUAL BASIC.NET

Learning the Visual Basic .NET Language
By: Apress Publishing
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 25
    2005-11-17

    Table of Contents:
  • Learning the Visual Basic .NET Language
  • The Evolution of VB .NET
  • Variables and Data Types
  • Arrays
  • Variable Operations
  • The String Class
  • Conditional Structures
  • Loop Structures
  • Functions and Subroutines

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Learning the Visual Basic .NET Language


    (Page 1 of 9 )

    This article presents an overview of the Visual Basic .NET language. It is excerpted from chapter three of the book Beginning ASP.NET in VB.NET: From Novice to Professional, written by Matthew MacDonald (Apress, 2004; ISBN: 1590592786).

    BEFORE YOU CAN CREATE an ASP.NET application, you need to choose a .NET language to program it. If you’re an ASP or Visual Basic developer, the natural choice is VB .NET. If you’re a longtime Java programmer or old-hand C++ coder, C# will probably suit you best. VBScript isn’t an option—it just doesn’t have the range, flexibility, and elegance a modern language demands.

    This chapter presents an overview of the Visual Basic .NET language. You’ll learn about the data types you can use, the operations you can perform, and the code you’ll need to define functions, loops, and conditional logic. This chapter assumes that you’ve programmed before and that you’re already familiar with most of these concepts—you just need to see how they’re implemented in VB .NET.

    If you’ve programmed with an earlier version of Visual Basic, you might find that the most beneficial way to use this chapter is to browse through it without reading every section. This approach will give you a general overview of the VB .NET language. You can then return to this chapter later as a reference when needed. But remember, though you can program an ASP.NET application without mastering all the language details, this deep knowledge is often what separates the casual programmer from the legendary programming guru.


    NOTE  
    The examples in this chapter show individual lines and code snippets. You won’t actually be able to use these code snippets in an application until you’ve learned about objects and .NET types. But don’t despair—the next chapter builds on this information, fills in the gaps, and presents an ASP.NET example for you try out.

    The .NET Languages

    The .NET Framework 1.1 ships with four languages: VB .NET, C#, JScript .NET, and J#. These languages are, to a large degree, functionally equivalent. Microsoft has worked hard to eliminate language conflicts in the .NET Framework. These battles slow down adoption, distract from the core framework features, and make it difficult for the developer community to solve problems together and share solutions. According to Microsoft, choosing to program in VB .NET instead of C# is just a lifestyle choice and won’t affect the performance, interoperability, feature set, or development time of your applications. Surprisingly, this ambitious claim is essentially true.

    .NET also allows other third-party developers to release languages that are just as feature rich as VB .NET or C#. These languages (which already include Eiffel, Perl, Python, and even COBOL) “snap in” to the .NET Framework effortlessly. The secret is the special machine.config configuration file that is installed with the .NET Framework. In one of its sections, the machine.config file lists the language compilers that are currently installed.

    <!-- Other configuration settings omitted.  -->
    <compilers>
       <compiler language="c#;cs;csharp" extension=".cs" 
       type= "Microsoft.CSharp.CSharpCodeProvider, System, Version=1.0.5000.0"/>
       
    <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"  
       type=
    "Microsoft.VisualBasic.VBCodeProvider, System, Version=1.0.5000.0"/>
       
    <compiler language="js;jscript;javascript" extension=".js" 
       type= "Microsoft.JScript.JScriptCodeProvider, Microsoft.JScript,
       Version=7.0.5000.0"/>
       
    <compiler language="VJ#;VJS;VJSharp" extension=".jsl" 
       type= "Microsoft.VJSharp.VJSharpCodeProvider, VJSharpCodeProvider,
       Version=7.0.5000.0"/>
    </compilers>


    TIP  
    To view the machine.config file, look for the directory [WinDir]\ Microsoft.NET\Framework\[Version]\Config. For example, after installing .NET 1.1 on a Windows XP computer, the machine.config file is placed in the directory C:\Windows\Microsoft.NET\Framework\v1.1.4322\Config.

    To install another .NET language, all you need to do is copy the compiler to your computer and add a line to the machine.config file. (Typically, a setup program will perform these steps for you automatically.) The new compiler will then transform your code creations into a sequence of IL (Intermediate Language) instructions.

    IL is the only “language” that the CLR recognizes. When you create the code for an ASP.NET web form, it’s changed into IL using the VB .NET compiler (vbc.exe), the C# compiler (csc.exe), the JScript compiler (jsc.exe), or the J# compiler (vjc.exe). You can perform the compilation manually or let ASP.NET handle it automatically when a web page is requested. We’ll discuss the difference between these two techniques in Chapter 5.

    More Visual Basic.NET Articles
    More By Apress Publishing


       · This article is an excerpt from the book "Beginning ASP.NET in VB.NET: From Novice...
     

    Buy this book now. This article is excerpted from chapter three of the book Beginning ASP.NET in VB.NET: From Novice to Professional, written by Matthew MacDonald (Apress, 2004; ISBN: 1590592786). Check it out at your favorite bookstore today. Buy this book now.

    VISUAL BASIC.NET ARTICLES

    - Clocks and Countdowns
    - User-defined Functions using Visual Basic Ap...
    - Understanding Object Binding in VBA
    - Mastering the Message Box
    - Testing a Windows Forms Application
    - Using Visual Basic.NET Features to Code a Wi...
    - Correcting Code in a Windows Forms Applicati...
    - Write Readable Code and Comments for Windows...
    - How to Code and Test a Windows Forms Applica...
    - Adding Features to a Windows Forms Applicati...
    - How to Design a Windows Forms Application
    - LINQ to XML Programming Using Visual Basic.N...
    - Understanding Delegates using Visual Basic.N...
    - Create a Sudoku Puzzle Generator using VB.NET
    - Entity Creation and Messaging in a VB.NET Te...





    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek