Vb. NET Summary (ii)

Source: Internet
Author: User
Tags case statement
Objective

The blog mentioned vb.net to a certain extent VB derived from, but they also have a number of different places, so today to tell a few aspects of the same or different places.

Content

Input and output

~ VB vb.net
Input Both enter information in the same way
Output Print statement The print statement was deleted, but the system console object, built-in Object MessageBox.Show () was added

Basic language elements
Namespaces: If you want to use the console class, you need to explicitly specify the call namespace.
Syntax: where data types, variable declarations, and arrays have changed, the following is specifically said.
Statement: VB.net's corresponding improvement:
1.GoSub is no longer supported;
Both 2.Call function and sub statements can be used for calling procedures;
3.On ... GoSub and on ... The goto statement is no longer supported and can be replaced with a Select Case statement;
4.While ... The Wend statement is changed to a while ... Endwhile statement, no longer supports the Wend keyword;
5.Set statement cancellation.
Class:
Vb. NET new, Private (within Class), public (accessible from Class), Friend (within the application to which class belongs), Protected (accessible only by class and its derived classes); Protected Friend (can be accessed by class, application, and derived classes); vb.net supports inheritance.
Procedures and functions

~ VB vb.net
Process Parentheses must be added when calling a function or sub without parentheses calling procedure Sub,call statement All method calls need to be parenthesized; The call statement is optional
Function ByVal or ByRef, the default value is the latter ByVal or ByRef, the default value is the former

File

~ VB vb.net
Sequential file The user opens with open, write#, print# statement writes the file, input#, inputline#, the INPUTB statement reads the file, EOF determines whether the file ends, the close# statement closes the file Create a StreamReader class instance open, invoke Read, ReadLine method reads of StreamReader class, create Stramwriter class instance with Write, WriteLine method to create or modify files, Close a file by using the closed method of a class instance
Random files Open statement creates or opens a file, writes a file with a put# statement, reads a file with a get# statement, locates a read-write location with the LOC function, and closes the file with a close# statement Open file with FileOpen function, FileGet function and FilePut function read and write to any record, must close random file with FileClose function

Database

~ VB vb.net
Database access Through ADO (Active x Data Object), RDO (Remote Data object), DAO (data Access Object) Using Ado.net and ADO (in COM components, by adding references)
Data access specific implementation Bind a database to a ADODC control or use a data environment or programmatically create a recordset Recordset object and Exchange data with a Recordset object Dynamically create, configure, and create a build dataset by creating, configuring data Adapters Dateadapter and generating dataset datasets, or by programmatically creating, configuring, and generating data sets
Data binding By setting properties such as DataChanged, DataField, DataFormat, DataMember, and DataSource, bind the display property of the control to the corresponding field in the data source You can bind any property of any control to any structure that contains data
Summary

VB is in fact part of the object-oriented, and now the vb.net is in fact the whole object-oriented. This video is a transition material to help us understand the object-oriented. If there is any inaccurate also please point out, if the feeling summed up still can move your little hand to a praise and then go ....

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.