Vb. The introduction of net programming Hello World (i)

Source: Internet
Author: User
Tags bind exception handling execution inheritance new features reference web services visual studio
Programming starts with this chapter, and we'll show you visual Basic with a series of lectures. NET's unique charm and the basic way to use it to develop applications. Visual Basic. NET is a development language developed by Microsoft in 2002, based on. NET platform applications, and a development language that Microsoft strongly recommends for developing. NET platform applications. First, let's take a quick look at visual Basic. NET, and its previous version, is the main difference between--visual Basic 6.0, the development language that has the most users in the world today.

One. Visual Basic and Visual Basic. NET's main differences:

Although it says visual Basic. NET is a successor to Visual Basic 6.0, but it seems to me that Visual Basic. Net
In addition to preserving the original traces of Visual Basic in grammar, the two remain similar or identical for almost 90% or more. But in many other ways, Visual Basic. NET is completely different from Visual Basic. Perhaps it is these differences that make visual Basic. NET features are more powerful and more robust, but it is also transformed into Visual Basic for Visual Basic programmers. NET programmer has brought difficulties. Because Visual Basic. NET has put forward many new functions, concepts and viewpoints, mastering visual Basic. NET is not only to master the grammar, but also to understand and apply these new functions, concepts and ideas. Of course, also need to master. NET Framework to understand the CLR (Common Language Runtime, when common language is in progress). The following is a brief discussion of the differences between data access, web development, and component creation in three aspects:

1. Data access:

The differences of data access technology, data access method and data binding are the main features of different points.

On data access technology, Visual Basic 6.0 implements access to the database through ADO (Active X data object, that is, an active X). At the same time, to ensure compatibility with earlier versions, there are two data access technologies for RDO (Remote Data Objects) and DAO (Data Access Objects). In Visual Basic. NET is the use of ado.net to access the database, Ado.net is part of the. NET Framework, and its corresponding class library is a true subset of the. NET Framwork SDK. The two technologies of ADO and ado.net have many differences in concept, function and implementation. Because of the space limit, here is not introduced. In fact, in visual Basic. NET can also use ADO to access the database, but ADO is in Visual Basic. NET in the form of a COM component, you can add a reference to the visual Basic. NET in use. The process of adding a reference is actually interoperability with COM components. The interop COM component is not already a COM component in its previous sense, but instead is converted to visual Basic. NET class library used directly by the. Net.

In the implementation of data access, Visual Basic 6.0 data access is mainly two methods: one is in the program design phase, you can bind the data source to the ADODC control or use the data environment; You can programmatically create recordset Recordset objects and Exchange data with Recordset objects. Also in Visual Basic. NET to achieve data access is mainly two kinds: one is in the program design phase, by creating, configuring data Adapters DataAdapter and generate DataSet dataset; Second, in the run, dynamically create, configure, and create data sets programmatically.

On data binding, implementing data Binding in Visual Basic 6.0 is achieved by setting the following properties of the control: datachanged, DataField, DataFormat, DataMember, and DataSource. Typically, you bind the display property of a control to the corresponding field in the data source. In Visual Basic. NET, data binding can be used in a wide range of applications, Visual Basic. NET, you can bind any property of any control to any structure that contains data.

2. Web development:

Visual Basic is created in a Web application using Active Server Page (ASP). In ASP, writing a Web page is not a pure Visual Basic language, but rather a Visual Basic scripting language--vbscript. In Visual Basic. NET is the use of ASP.net technology to write Web pages. The asp.net is no longer a scripting language, but a true meaning programming language, which can be visual Basic. Net. The development of ASP page friends are clear, although the development of ASP page to develop tools requirements are very low, but because it is process-oriented development, so slightly more complex ASP code are messy, which all to the design, debugging, modification brought trouble. and visual Basic. NET is based on the new frame structure, Visual Basic. NET fully supports Web programming. Web-based features such as asp.net Web applications, XML Web services, and so on, make visual Basic. NET development Web pages are similar to the development of Windows programming, and Web page code does not appear to be methodical.

3. Component creation:

In using Visual Basic 6.0 and Visual Basic. NET writing an application, although you can add components to your application by selecting components from the Toolbox, the two are fundamentally different in their implementation mechanism. In Visual Basic 6.0, the components that are created in an application are all COM components, ActiveX controls that can be used in COM applications, ActiveX-type DLLs, and ActiveX-type EXE. And in Visual Basic. NET, the components dragged into a form are based on inheritance, inherit from the corresponding classes in the SDK provided by the. NET Framework, and, after instantiation, add the components to the design form by adding functionality. These procedures are available in visual Basic. NET source code to find. Visual Basic. NET is derived from either the component or the control base class for each component used in the

Of course, Visual Basic and Visual Basic. NET also has many differences, such as: Visual Basic 6 provides only single-threaded mode and does not support multithreading. And in Visual Basic. NET full support for multithreading. And in Visual Basic. NET also adds new features such as structured exception handling. So for those of Visual Basic programmers, transition from Visual Basic programmers to Visual Basic. NET has the extremely strong necessity, below briefly introduces this necessity.

Two Transition from Visual Basic to Visual Basic. NET is necessary and necessary:

Although Visual Basic has been recognized by many people, there are many supporting products that provide Visual Basic interfaces. But with the continuation of time, its shortcomings are gradually exposed, and some even can not "tolerate". First of all, as an interpretive language, not only does the program execute slowly, but also needs to take an interpretation library when distributing the application; second, Visual Basic is not a complete object-oriented development language, and fundamentally it should be a process-oriented development language.

and visual Basic. NET as the next generation of Visual Basic language, it is a kind of development. NET platform applications and tailor-made programming languages. Because Visual Basic. NET is fully integrated with the. NET Framework (. NET frameworks) and the CLR (Common Language Runtime, the common language runtime). Both the. Net framework and the common language runtime also provide visual Basic. NET language interoperability, garbage resource recycling, reliable security, and versioning support. Through visual Basic. NET can be created easily and quickly. NET platform applications, XML Web services, and ASP.net Web applications. Visual Basic. NET as a programming language for developing the. NET platform, it creates the possibility of developing a cross-platform program. As we know, Microsoft launched. Net, one of the purposes is to achieve cross-platform. Although Microsoft currently only provides the Windows platform to run. NET Framework, but with the advent of mono (although there are many problems and the current mono only supports C #), it can be foreseen that in the near future, Visual Basic. NET implements write Once and Run anywhere for a long time.

Visual Basic. NET is a compiled language, but this compilation differs from the previous compilation of contacts. Because after visual Basic. NET compiler to get files is not a binary file that can be run directly on your computer. Its nature is an IL file (Intermediate language file). When you run the Il file, you first compile the Il file into a binary file by using the JIT (Just-in-time compiler) under the CLR. We see the program running, which is actually a JIT-compiled binary file in execution. At this time may have a lot of friends will ask, this two compile is superfluous, concrete implementation is very troublesome, whether will affect the speed of the program? The two compilation does affect the speed at which the program runs, but it is possible for Cross-platform implementations. In fact, this compilation process is like a Java JVM (Java Virtual machine). It is the JVM that enables Java to develop Cross-platform applications. Two compilation is the conversion of the CLR to the binary file automatically in the. NET Framework, which is automatic and does not require the participation of the person, so it does not cause trouble to program execution.

Visual Basic. Net is also a true object-oriented development language, and it can be said that oop ideas have gone deep into any corner of the language, such as in Visual Basic. NET, the Windows components that are created in the class are inherited from classes, and the classes are instantiated. Visual Basic. NET also adds a number of new and improved features, such as inheritance, interfaces, and overloads, all of which make visual Basic. NET becomes a powerful object-oriented programming language.

Microsoft is introducing visual Basic. NET, it also introduces visual Basic. NET development tools, visual Studio. Net. Java Programmers Envy Visual Basic. One of the important reasons for net programmers is that Visual Basic. NET has an integrated development environment--visual Studio. NET that is better than the development environment currently used by Java programmers.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.