Decision
making structures require that the programmer specify one or
more conditions to be evaluated or tested by the program, along with a
statement or statements to be executed if the condition is determined to
be true, and optionally, other statements to be executed if the
condition is determined to be false. Following is the general form of a
typical decision making structure found in most of the programming
languages:
Learn From Experience
Thursday, 20 March 2014
VB.NET Loop
VB.Net - Loops
There may be a
situation when you need to execute a block of code
several number of times. In general statements are executed
sequentially: The first statement in a function is executed first,
followed by the second, and so on. Programming languages provide various
control structures that allow for more complicated execution paths. A
loop statement allows us to execute a statement or group of
statements multiple times and following is the general form of a loop
statement in most of the programming languages:
VB.Net provides following types of loop to handle looping requirements. Click the following links to check their detail.
Loop Type | Description |
---|---|
Do Loop | It repeats the enclosed block of statements while a Boolean condition is True or until the condition becomes True. It could be terminated at any time with the Exit Do statement. |
For...Next | It repeats a group of statements a specified number of times and a loop index counts the number of loop iterations as the loop executes. |
For Each...Next | It repeats a group of statements for each element in a collection. This loop is used for accessing and manipulating all elements in an array or a VB.Net collection. |
While... End While | It executes a series of statements as long as a given condition is True. |
With... End With | It is not exactly a looping construct. It executes a series of statements that repeatedly refers to a single object or structure. |
Nested loops | You can use one or more loop inside any another While, For or Do loop. |
Loop Control Statements:
Loop control statements change execution from its normal sequence.
When execution leaves a scope, all automatic objects that were created
in that scope are destroyed.
VB.Net provides the following control statements. Click the following links to check their detail.
Control Statement | Description |
---|---|
Exit statement | Terminates the loop or select case statement and transfers execution to the statement immediately following the loop or select case. |
Continue statement | Causes the loop to skip the remainder of its body and immediately retest its condition prior to reiterating. |
GoTo statement | Transfers control to the labeled statement. Though it is not advised to use GoTo statement in your program. |
Wednesday, 19 March 2014
VB.Net Web Programming
A dynamic web application consists of either or both of the following two types of programs:
- Server-side scripting - these are programs executed on a web server, written using server-side scripting languages like ASP (Active Server Pages) or JSP (Java Server Pages).
- Client-side scripting - these are programs executed on the browser, written using scripting languages like JavaScript, VBScript etc.
The ASP.Net application codes could be written in either of the following languages:
- Visual Basic .Net
- C#
- Jscript
- J#
VB.Net XML Processing
The Extensible Markup Language (XML) is a markup language much like
HTML or SGML. This is recommended by the World Wide Web Consortium and
available as an open standard.
The System.Xml namespace in the .Net Framework contains
classes for processing XML documents. Following are some of the commonly
used classes in the System.Xml namespace.
VB.Net Send E-mail
VB.Net allows sending E-mails from your application. The System.Net.Mail namespace contains classes used for sending emails to a Simple Mail Transfer Protocol (SMTP) server for delivery.
The following table lists some of these commonly used classes:
S.N | Class | Description |
---|---|---|
1 | Attachment | Represents an attachment to an e-mail. |
2 | AttachmentCollection | Stores attachments to be sent as part of an e-mail message. |
3 | MailAddress | Represents the address of an electronic mail sender or recipient. |
4 | MailAddressCollection | Store e-mail addresses that are associated with an e-mail message. |
5 | MailMessage | Represents an e-mail message that can be sent using the SmtpClient class. |
6 | SmtpClient | Allows applications to send e-mail by using the Simple Mail Transfer Protocol (SMTP). |
7 | SmtpException | Represents the exception that is thrown when the SmtpClient is not able to complete a Send or SendAsync operation. |
VB.Net Database Access
Applications communicate with a database, firstly, to retrieve the data stored there and present it in a user-friendly way, and secondly, to update the database by inserting, modifying and deleting data.
Microsoft ActiveX Data Objects.Net (ADO.Net) is a model, a part of the .Net framework that is used by the .Net applications for retrieving, accessing and updating data.
ADO.Net Object Model
ADO.Net object model is nothing but the structured process flow through various components. The object model can be pictorially described as:VB.Net Regular Expressions
A regular expression is a pattern that could be matched
against an input text. The .Net framework provides a regular expression
engine that allows such matching. A pattern consists of one or more
character literals, operators, or constructs.
Constructs for Defining Regular Expressions
There are various categories of characters, operators, and constructs
that lets you to define regular expressions. Click the follwoing links
to find these constructs.
- Character escapes
- Character classes
- Anchors
- Grouping constructs
- Quantifiers
- Backreference constructs
- Alternation constructs
- Substitutions
- Miscellaneous constructs
The Regex Class
The Regex class is used for representing a regular expression.
The Regex class has the following commonly used methods:
Subscribe to:
Posts (Atom)