Three Topics
ITC 172 focuses on three seperate but related topics:
- Visual Basic
- ASP.Net
- ADO.Net
Visual Basic
Visual Basic History
Basic has been around for almost as long a Personal computers. It was included with DOS. Originally every line was numbered and it was limited to 32000 lines. There was no way to implement structured programming. For many years Basic was primarily a language for hobbiests.
Microsoft extended Basic's abilities with Quick Basic. Quick basic removed the requirement for line numbers and introduced the idea of sub procedures and functions which allowed a more structured programming approach.
With Windows 3.1, Microsoft introduced the First Visual Basic. It was Visual because it provided a windows form and common controls that could be dragged onto the form. Visual basic climbed in popularity though it was still primarily used by hobbiests
That changed with Visual Basic 5.0, and even more so with Visual Basic 6.0. These versions introduced ADO(Active X Data Objects). ADO was a wrapper for Window's OLEDB database connectivity libraries. OLEDB was complex and difficult to Navigate. ADO provided a simplified interface to OLEDB and made it much easier to work with database Data. Because of this, Visual Basic became, for the first time a professional level language used widely in database applications.
Visual Basic is often considered a Rapid Development Language. It is relatively easy and fast to develop Visual Basic applications. Often prototypes are developed in VB for testing and then translated into another language such as C++ for the final product. And sometimes the application itself is developed in VB because of the shorter development times make it more cost effective
.Net
Around 2001-2002 Microsoft introduced .Net. They had developed the .Net framework to meet several new challenges. The biggest of these was the World Wide Web. Microsofts previous technologies--Active X, including ADO, COM and DCOM, were not sufficient. They were binary, windows dependent, and percieved as security threats. The .Net framework replaced the binary proprietary code of COM and ActiveX with XML. It also introduced a Just In Time Compiler (JITC) that allows a developer to develop one application and potentially deploy it on any operating system. (Similar to Java's virtual machine).
As part of the major .Net initiative, Visual Basic was rewritten. The changes were substantial and many Visual Basic programmers were upset, but there continues to be a huge base of Visual Basic programmers.
Features of Visual Basic.Net
Visual basic gained several things by being made into a .Net language. For one, it became, for the first time a fully object oriented program. It became a much more flexible language for the web.
Visual Basic differs from most languages in several important ways
- It is not case sensitive
- It does not end statements with a semicolon (the invisible end line character is the statement terminator)
- It does not use curly braces to mark the beginning and ending of programming blocks. Instead it uses the key word "end" or some oher term.
ASP.Net
ASP stands for Active Server Pages. It is Microsoft's technology for creating server side Web applications. It is Window's and IIS (Internet Information Services) dependent--though theoretically ASP.Net could be run on other platforms.
Classic ASP
Classic ASP was mostly written in what is called VBScript--a subset of Visual Basic 6.0. Classic ASP resembled PHP or other scripting languages in that the code was mingled with the html.
ASP.Net
ASP.Net offered several improvements over classic ASP. For one thing it included many new and powerful controls that could be dragged onto a web form and configured as the developer wished. For another, it allowed the developer to seperate the programming code from the html code--a feature called "code behind." This makes it easier to debug and maintain the site. It also makes it more scalable and flexible.
Versions of ASP.Net
The first versions of ASP.Net (1.0 and 1.1) had the features listed above, but they did not support the xhtml standard. Rather they were aimed at HTML 4.0. They also didn't allow the developer to format the HTML as they wished. (in terms of how you indent the HTML, etc) This was the source of a great frustration to developers
Version 2.0 of ASP.Net did target xhtml and allowed the developer to format the layout of the xhtml as they wished. It also simplified the model somewhat by introducing partial classes. Partial classes allow a single class to exist as more than one file. In windows forms, for instance, one part of the class contains the developer's code and the other part of the class contains the designer code generated by Visual studio which initializes all the form components. In ASP.Net the Designer part of the class--the part that initializes all the controls on the web form--is created at runtime.
ASP.Net 3.5 (Visual Studio 2008) adds the ability to target your web pages to any previous framework. It also add Ajax tools to the web development suite.
ADO.Net
We have already discussed ADO some when talking about why Visual Basic become popular as a development language. In .Net ADO names a set of objects that are designed to facilitate working with data and databases
Main ADO Objects
Below is a short list of major data objects. Except for the DataSet each of the objects listed is part of a specific provider. For instance a command object for SQL server would be SqlCommand, and one for Oracle would be OracleCommand.
- Connection object
- The connection object is used to connect to databases or data aware objects.
- Command Object
- The command object is used to pass SQL to the database, and it can use the DataReader object to read data from a database
- DataSet
- A dataset is an in memory object that can store one or more tables of data in the client while detatched from the database.
- DataAdapter
- A dataAdapter is used to fill the Dataset with data, and to write the data back to the datasource
In addition to the ADO objects, many controls are data aware and can be "bound" to a data source
Visual Studio 2008 adds a new set of libraries called LINQ. LINQ to SQL is a built-in O/RM (object relational mapper) that ships in the .NET Framework 3.5 release, and which enables you to easily model relational databases using .NET classes. You can use LINQ expressions to query the database with them, as well as update/insert/delete data.