|
|
|||
| H o m e | |||
|
|
Getting Started With .Net, VB.Net, and VS.Net 2002/2003
NOTE: For those new to .NET.
Jumping head-first into .NET without a plan of action is like visiting New York City for the first time - without a guidebook and map. You won’t know what to see first or how to get there.
This article will guide you to key .Net concepts and provide a map to the resources a .Net beginner needs.
Index
#1 – Address the .NET learning curve first, build applications second.
#3 – Get a clear understanding of what constitutes the .NET technology.
Step #1 – Address the .NET learning curve first, build real-world applications second.
Don’t waste time trying
to create real world applications before you get through steps 2 through 7
below.
#3 – Get a clear
understanding of what constitutes the .NET technology.
Microsoft®.NET® is an extremely powerful development framework, but it is new, large, and complex. It includes two major components, the Common Language Runtime and the .Net Framework Class Library – both of which you must grasp before you can be effective with .Net. Visual Basic is now VB.NET, a changed and expanded version of Visual Basic. Likewise, ADO.NET is a changed and expanded version of previous versions of ADO.
Because it is new, large, and complex you are facing a big learning curve. .Net programmers with 1, 2, and more years of experience with .Net still report they are going through the learning curve. Most report it takes a minimum of six months of learning and practice before one can create a real-world application with .Net. Some programmers are still struggling with the learning curve - one or more years after getting started with .Net.
You can learn from the experiences of the programmers who have crossed over into .Net before you. Based on what has worked and what has not worked for them, it is possible to identify a road map that will speed you through your .Net learning curve.
The road map is the seven steps listed above. The road map leads you to the .Net concepts that are important to a .Net beginner, then steps you through them one byte at a time.
The rest of this installment of the article discusses why each step is important to a .Net beginner. Future installments will show how to implement each step.
#2 – If you don’t have a good foundation knowledge of object-oriented programming (OOP); get it now.
You can’t do anything significant in .Net without OOP. .Net is OOP through and through. It comes with 1,000’s of objects from which you will build applications. You will need to create your own objects too. Almost every .Net Help topic discusses the use of objects, making it difficult to understand if you are OOP illiterate. A good foundation of OOP knowledge is a prerequisite to using Microsoft®.NET correctly. This step will present the ‘must know’ parts of OOP and point you to good resources where you may expand your OOP knowledge.
#3 – Get a clear understanding of what constitutes the .NET technology.
Grasping the major components of the .Net Framework is another prerequisite. The .Net Framework contains the parts to build your application and the engine that will run it. You need to know what parts are available from the .Net Framework Class Library so you can use them in your applications. You need to know how the .Net Framework Common Runtime Engine works so you can write code that is fast, reliable, and secure. This step will present the ‘must know” parts of the .Net Framework and point you to good resources where you may expand your knowledge of the .Net Framework.
#4 – If you are an experienced VB programmer, learn the differences between VB.NET and previous versions of Visual Basic.
VB.OLD <> VB.NEW. If you
are a VB.OLD programmer watch out for this trap, it has frustrated many.
On the one hand your experience with VB.OLD can help you learn .Net. On
the other hand, your VB.OLD experience can really trip you up. This step
will help you know how to understand the differences and will point you to
help and support that explains the differences.
There is help and support out there for just about any .Net question you may have – if you can find it. There is so much help and support available for .Net programmers that it can be very hard to find exactly what you need. .Net Help comes with the .Net Framework and Visual Studio.NET. The Microsoft MSDN site is filled with 1,000’s of .Net topics and examples. The Internet contains even more. There are Microsoft sponsored sites like GotDotNet.com and WindowsForms.net. This step show you the best sources for help and support and how to locate what you need.
#6 – Use the help systems to master the .NET and VB.NET basics.
You are a Visual Basic programmer; you need to know how to use the .NET and VB.NET help and support systems. You need to learn the differences between VB.OLD and VB.NEW. There are special help and support systems for VB.NET. There are large collections of code examples just for VB.NET. This step will identify the VB.NET help and support systems and show you how locate help and support tailored to .NET and VB.NET beginners.
#7 - If you use or will use databases in your applications, take the time now to study ADO.NET.
ADO <> ADO.NET. If you have used a previous version of ADO watch out for this trap. A common approach for many has been to learn a little about ADO.NET and then mix ADO.OLD thinking with a few ADO.NET concepts to hack together something that ‘works’. ADO.NET is a large and very important subject unto itself. Study it in depth to learn how it has changed and grasp the new data access tools it contains. This step will present key ADO.NET concepts and identify ADO.NET help and support resources where you can learn more.
#8 – Design, develop, test, and deploy some SIMPLE VB.NET applications.
Steps 2-7 <> Mastery of .Net. When you reach step eight you have a foot in the .Net door, just a foot. The next thing you should do is use the road map to build dozens of small applications. This step will recommend what things to practice and how to continue using the road map to expand your .Net and VB.NET skills.
From .Net Help: “When you create an application in Visual Basic .NET, you constantly work with objects. You can use objects provided by Visual Basic — such as controls, forms, and data access objects or can also control objects from other applications within your Visual Basic application. You can even create your own objects, and define additional properties and methods for them. Objects act like prefabricated building blocks for programs — they let you to write a piece of code once and reuse it over and over.”
This installment of the article presents an OOP beginner with the ‘must know’ concepts of OOP and points to good resources where the ‘must know’ concepts can be learned.
Read the article at the link below first to get introduced to the most basic concepts any OOP programmer needs. These are some very powerful concepts. Master these concepts and you will be well on the way to becoming a full-fledged OOP programmer.
A Practical Introduction to OOP. Part 1 - You ARE an OOP Programmer!
Next, study the concepts in more depth using the articles links below. The articles are provided in the order they should be studied. Article links include instructions to steer you away from more advanced concepts for now. Don’t expect to understand everything in one pass. Count on 12-15 hours of study to build a very basic OOP foundation for programming with VB.NET.
Common Type System Overview Read to the end of the Values and Objects section. Declaring Variables Read to the end of the Declaring Data Type section. Using The New Keyword Read to the end of the article. What is an Object? Read to the end of the article. Classes: Blueprints for Objects Read to the end of the Classes and Objects section. Introduction to Objects In Visual Basic Read to the end of the Fields, Properties, Methods, and Events section. Declaring Object Variables Read to the end of the Access to Object Variables section. The Basics Of Working With Objects Read to the end of the article. Object-Oriented-Programming in Visual Basic.Net Read to the end of the Using System Object section. Resource Management Read to the end of the article.
Finally, return to the Classes: Blue Prints For Objects article to start getting acquainted with these OOP concepts: Abstraction, Encapsulation, Polymorphism, and Inheritance. As a beginner you need not know a lot about these particular OOP concepts – just enough to get acquainted.
Classes: Blue Prints for Objects Read the Abstraction, Encapsulation, Polymorphism, and Inheritance sections.
Step #3 – Get a clear understanding of what constitutes the .NET technology.
In its broadest form the .NET technology is more than just a tool for developing VB.NET applications. Visit the link below to see how Microsoft defines the .Net technology.
Microsoft .NET Basics: What Is .NET?
Within the .Net technology Microsoft provides two developer tools, Visual Studio.NET and the Microsoft .Net Framework. Visit the link below to see how Microsoft defines the .Net developer tools.
Microsoft Visual Studio.NET
Visual Studio.NET is Microsoft’s integrated development environment for creating applications.
Microsoft .Net Framework
This is the part of .Net technology that is most important to you, the programmer. The .Net Framework is used to develop, deploy, and execute applications. The Framework consists of two main parts – 1) the .Net Framework Class Library and 2) the Common Language Runtime (CLR).
1) The .Net Framework Class Library is a large collection of reusable types that are used to develop .Net applications. Visit the link below to see the types available.
.Net Framework Types See the Type Classification diagram.
The .Net Framework’s reusable types are building blocks for your applications. Here are some examples of how the .Net Framework types relate to the .Net programs you will create:
Class Types - A Windows Forms Button is a .Net Framework Class type that is used to add a Button object to a Windows Forms application.
Value Types – System.Int32 is a .Net Framework Value type that can be used to declare a variable that can hold a 32 bit integer value.
VERY IMPORTANT: The .Net Framework Class library is very important to your future as a .Net programmer. To be a top notch .Net programmer you must improve your ability to select the right .Net types for your programming tasks. You must learn what types are available and the capabilities of each. You must learn how to best design with, implement, and program each type. It is only after you know what types are available and how to use each type that you have the knowledge to put the .Net Framework Class library to best use.
From the .Net Framework Types link above drill down into the different types to learn more.
2) The Common Language Runtime (CLR) is the engine that compiles, executes, and manages .Net applications.
The CLR includes features which manage compilation, memory, threads, version conflicts, safe execution of code, strict type safety, and remoting.
VERY IMPORTANT: It is up to you to put the features of the CLR to best use – they are not automatic. While you need not know anything about the CLR to create and execute a Hello World! application with .Net, you do need to know how the .Net Framework Common Runtime Engine works if you want to write code that is fast, reliable, and secure. Visit the links below to begin building your knowledge of the CLR.
Intro To The .Net Framework Read to the Client Application Development section.
.NET Framework Home: Microsoft .NET Framework FAQ Read the entire
article to learn more about how your code affects the way the CLR
performs. Most questions at this link represent the common challenges of
the CLR that each .Net programmer must face.
Visual Basic.Net is more than just an incremental upgrade. From Visual Basic.Net help:
“As a veteran Visual Basic developer, you have undoubtedly invested a lot of time and effort in learning the intricacies of Visual Basic. At first glance, it may appear to you that Visual Basic .NET is so radically different from what you know that you will have to learn it all over again. In reality, while many things have changed, the overall experience of developing in Visual Basic remains essentially the same. Your knowledge of Visual Basic will help you immediately become productive in Visual Basic .NET.”
“There are, however, a number of changes to Visual Basic that will require you to adjust your mindset and set aside some old habits. Some of the rules for the language, tasks such as debugging and deployment, and even some terminology have changed — often in subtle ways. Ultimately, the changes make Visual Basic easier and more powerful than ever before.”
So what is the best way to “adjust your mindset and set aside some old habits”?
The best way is to study the differences between VB.OLD and VB.NET. The remainder of this article installment is devoted to pointing your to the best resources for discovering the differences.
VB.NET For Visual Basic Veterans This is the entry point to a very large collection of articles which discuss all the differences between VB.OLD and VB.NET.
Language Changes This is the entry point to articles that focus on the language differences.
Control Changes Almost all Visual Basic 6 controls and their VB.NET counterparts are covered here.
What's New in VB.NET Learn more about what has changed by finding out what is new.
What's New With Data One area that has changed significantly is data programming with ADO. Theses articles will acquaint you with some of the differences.
Are you looking for some of your old VB6 friends in VB.NET? They may be hiding in the VB6 compatibility library, one of the most misunderstood libraries in Microsoft®.NET. Because Visual Basic.Net and the Microsoft®.NET Framework introduce a lot of change to the Visual Basic Veteran, Microsoft created the VB6 compatibility library. It is used by the Upgrade Wizard when it upgrades VB6 code to VB.NET. It can also be used by you to put what you know about VB6 to work in VB.NET. Learn more about it to see if it applies to you. VB6 Compatibility Library This special library allows you to add back VB6 functionality. You must add a project reference to this library to use it; it is not automatically added to a new Visual Studio.NET VB.NET project. If you really need to stick to VB6 like code and classes, especially when upgrading projects or writing your first new VB.NET projects, this library may be for you. When you visit the link you will see a warning which was misinterpreted by some to mean that the library should not be used in new VB.NET applications, only in upgrades. In April 2002, Edward Robinson, Program Manager for Visual Basic.Net clarified the use of the library: “Let me clarify this: DirListBox, DriveListBox, and FileListBox were developed to give compatibility with VB6. Like everything else in the Compatibility Library, these are 100% managed code, written in VB.NET. You can use them in applications written in VB.NET, C#, J# or any other .NET language. There is no plan to stop supporting them in the foreseeable future. The controls are in the compatibility namespace because they were designed as direct replacements for the VB6 versions. Because of this, their object models differ from the Windows Forms standards. Their primary purpose is to help with upgrading projects, but you can certainly use them for writing new applications.”
The VB6 Compatibility library is also an excellent way to learn the differences between VB.OLD and VB.NEW.
Step #5 – Identify and master the .NET help systems.
There is help and support out there for just about any .Net question you may have – if you know where to find the help and support resources. This Getting Started step shows you where to find some of the best resources for .Net help and support.
START HERE à The .Net Framework SDK
Getting started with .Net? Start here. Ready to take on Threading? Start here. Wondering what Remoting is? Start here. Struggling with a .Net coding problem? Start here.
The .Net Framework SDK is an ‘operating manual’ for .Net. It contains an extensive collection of .Net documentation, samples, tools, and technology introductions.
Spend at least 100 hours studying and practicing with the .Net Framework SDK resources to avoid mis-understandings about .Net and how best to implement .Net solutions.
The .Net Framework SDK can be used off-line if you have installed it on your computer.
The .Net Framework Support Center
This is the center of the .Net resource world for .Net developers. Concentrated on one web page are links to the most important .Net issues, downloads, examples, and Microsoft .Net newsgroups.
The Visual Basic.Net Support Center
This is the center of the Visual Basic.Net world for VB.NET developers. Concentrated on one web page are links to the most important VB.NET downloads, upgrades, examples, utilities, and VB.NET newsgroups.
101 Code Examples For Visual Basic.Net
Download over 101 Visual Basic.Net projects here, each demonstrating dozens of VB.NET concepts. If you like to learn from code examples, this is THE source for VB.NET.
All Visual Basic.Net How-To Articles
Microsoft How-To articles are solutions created to solve common problems encountered by programmers using a Microsoft technology. For example: HOW TO: Handle Document Events in a Visual Basic .NET Application.
All Visual Basic.Net Bug Articles
If you are wondering if that bug you have been chasing for days is really your problem or a problem with Visual Basic.Net, visit this page.
GotDotNet: The Microsoft .NET Framework Community
This is a Microsoft site devoted to the .Net Framework Community. It is a very interesting site with articles, samples, forums, and many other resources useful for getting started and resolving .Net coding questions.
This is “The Official Microsoft Windows Forms Community Site”, a place where you can Windows Forms articles, samples, a control gallery, and forums where you can get help and support.
This is “The Official ASP.NET Site”, a place where you can find ASP.NET sample code, tutorials, a control gallery, and forums where you can get help and support.
.NET Code Wise Community - Online Communities
.NET Code Wise Online Communities offer a wide range of fresh content through Web articles, discussions, message boards, and code samples. DevCity is a member of the .Net Codes Wise Community.
Magazines
There is not enough room in this short article to cover all the great .Net help and support resources available. This article provides twelve of the best places where you can most quickly get the help and support you need.
Step #6 – Use the help systems to master the .NET and VB.NET basics.
Within the .NET help and support systems covered in part five of this article are specific resources for getting to know the basic concepts of .NET and VB.NET. The resources that cover the basics are ideal for a programmer getting started with .NET and VB.NET.
Quick Starts
Quick Starts provide just enough code and explanations to get you started with a basic .Net concept. Some of the best are found in the .Net Framework SDK. Many .Net programmers report that spending enough times with these quick starts greatly reduces frustration and confusion in the .Net learning curve. Below are links to the quick starts that can be your foundation for learning .Net and VB.NET.
Walkthroughs
Walkthroughs help you expand on what you learn from quick starts. Each walk through guides you through a .Net task e.g. visual inheritance, data access, persisting an object, and so forth. Below are the links that lead to the walk throughs that are essential to getting started with .NET and VB.NET.
Sample Code
From .Net help: “There are many sources of code within the Visual Basic documentation set. This topic helps you get started in locating that code. Note that some of this code is contained within topics that provide further explanation or instructions on how to perform a task, whereas some is contained in special topics devoted only to displaying a code example.” Here are links to the code resources best suited for a beginner.
Code for Visual Basic Programmers
Magazines
MSDN Magazine – See the Basic Instincts column in each issue.
Visual Studio Magazine – See the Getting Started column in each issue.
There is not enough room in this article to cover all the great .Net help and support resources available. This article provides some of the best resources that focus on getting started with .NET and VB.NET.
Next issue: If you use or will use databases in your applications, take the time to study ADO.NET now.
Step #7 - If you use or will use databases in your applications take the time to study ADO.NET now.
ADO <> ADO.NET. If you have used a previous version of ADO watch out for this trap. A common approach for many has been to learn a little about ADO.NET and then mix ADO.OLD thinking with a few ADO.NET concepts to hack together something that ‘works’. ADO.NET is a large and very important subject unto itself. Study it in depth to learn how it has changed and grasp the new data access tools it contains. This getting started step presents key ADO.NET concepts and identifies ADO.NET help and support resources where you can learn more.
Introductions
No matter what you do with data, there are certain fundamental concepts that you should understand about the data approach in ADO.NET. Introduce yourself to ADO.NET by reading the articles at the links below.
.NET Data Access Architecture Guide – Read from the section titled Introduction to ADO.NET until you reach the sub-section titled Generic Programming.
Introduction to Data Access with ADO.NET – This article introduces ADO.NET’s DataAdapter and DataSet as the disconnected approach to data access programming. From .Net Help: “In the dataset model, you create an in-memory store of the records you want to work with, load the store using a data adapter, manipulate the data, and then, optionally, use the data adapter to write changes back to the database.”
Introduction to DataCommand Objects in Visual Studio – this article introduces ADO.NET’s DataCommand and DataReader as the direct approach to data access programming. From .Net Help: “In this model, you configure a data command object with an SQL statement or the name of a stored procedure. You then execute the data command. If the command returns a result set, you use a data reader object to fetch the data.”
Comparison of ADO.NET and ADO - Are you and ADO veteran? Examine the differences between ADO.OLD and ADO.NET here.
By the time you get through the reading above you should have a basic understanding of these ADO.NET concepts: Data Provider, Connection, DataAdapter, DataSet, DataCommand, DataReader, disconnected data access, direct data access.
Connection
A connection to a data source is required for both the disconnected and direct approaches to ADO.NET data access programming. Learn more about Connections at the link below.
Exchanging Data between a Data Source and an Application
The Disconnected Approach: Using DataAdatpers and DataSets.
The Direct Approach: Using DataCommands and DataReaders. At times you may find it useful to bypass datasets and communicate directly with the data source.
Performing Database Operations Directly – More articles on the direct approach.
Disconnected or Direct Approach?
You can and should use both approaches for data programming tasks. Knowing when to use one approach over the other is important. Visit the link below for advice on when to use the disconnected approach and when to use the direct approach.
Recommendations for Data Access Strategies
Data Walkthroughs
With the basic introductions out of the way tackle the .Net Help Data Walkthroughs you will find at the link below.
Code Resources
Code for Common Data-Programming Tasks
Other ADO.NET Resources
Using the ADO.NET DataSet for Multitiered Apps
Techniques in Filling ADO.NET DataTables: Performing Your Own Analysis
Application Design Guidelines: From N-Tier to .NET
Designing Data Tier Components and Passing Data Through Tiers
Step #8 – Design, develop, test, and deploy some SIMPLE VB.NET applications.
If you have completed steps 1-7 you have a good foundation for building some simple – but complete – VB.NET applications. At this point you should know what VB.NET concepts are important, where to find .NET and VB.NET resources, and you should have some basic concepts out of the way.
With a foot in the .Net door this is a good time for you to build dozens of small applications to improve your skills and grow your knowledge. But what kinds of applications should you build?
In the part five of this article I included a link to a Microsoft MSDN web page where you can download 101 Code Examples for Visual Basic.Net. These 101 examples cover a wide variety of things a VB.NET programmer may need to do when creating applications. Most are examples of performing basic tasks like printing, use of Windows Forms controls, Office InterOps, and the like.
Here is a suggestion. Use the concepts covered in the 101 Code Examples to design your practice applications. Pick the examples that most closely match the skills you expect to need first as a new .Net programmer. Combine several of the code examples into each of your practice applications e.g. the File System, File Notifications, and Reading and Writing with a Text File sample projects might make one good practice application. You should end up with a couple of dozen practice applications.
Each practice application will challenge you to put what you have learned to use. As programming issues come up you can return to steps 1-7 to reinforce what you have learned and to seek out additional information. You will also have the 101 Code Examples for Visual Basic .Net as resources.
If you have not downloaded the 101 Code Examples, here is the link again.
101 Code Examples for Visual Basic.Net
This article started with the following paragraph:
“Jumping head-first
into .NET without a plan of action is like visiting New York City for the
first time - without a guidebook and map. You won’t know what to see first
or how to get there. You will get frustrated and lost.”
|
||
|
Copyright © 2001-2007 aZ Software Developers. All rights reserved. |
|||