Bahasa pemrograman Visual Basic, yang dikembangkan oleh Microsoft sejak tahun 1991, merupakan pengembangan dari pendahulunya yaitu bahasa pemrograman BASIC (Beginner’s All-purpose Symbolic Instruction Code) yang dikembangkan pada era 1950-an. Visual Basic merupakan salah satu Development Tool yaitu alat bantu untuk membuat berbagai macam. MsgBox(sb.ToString) ' This code produces the following output: ' fox ' the ' brown ' jumps ' quick Secondary Descending Sort The next example demonstrates how to use the Order By Descending clause in a LINQ query to perform a primary sort, in ascending order, and a secondary sort, in descending order.

  1. Contoh Coding Visual Basic
  2. Contoh Coding Visual Basic Practice
  3. Contoh Coding Visual Basic Coding
-->

A sorting operation orders the elements of a sequence based on one or more attributes. The first sort criterion performs a primary sort on the elements. By specifying a second sort criterion, you can sort the elements within each primary sort group.

The following illustration shows the results of an alphabetical sort operation on a sequence of characters.

The standard query operator methods that sort data are listed in the following section.

Methods

Method NameDescriptionVisual Basic Query Expression SyntaxMore Information
OrderBySorts values in ascending order.Order ByEnumerable.OrderBy
Queryable.OrderBy
OrderByDescendingSorts values in descending order.Order By … DescendingEnumerable.OrderByDescending
Queryable.OrderByDescending
ThenByPerforms a secondary sort in ascending order.Order By …, …Enumerable.ThenBy
Queryable.ThenBy
ThenByDescendingPerforms a secondary sort in descending order.Order By …, … DescendingEnumerable.ThenByDescending
Queryable.ThenByDescending
ReverseReverses the order of the elements in a collection.Not applicable.Enumerable.Reverse
Queryable.Reverse

Query Expression Syntax Examples

Primary Sort Examples

Primary Ascending Sort

The following example demonstrates how to use the Order By clause in a LINQ query to sort the strings in an array by string length, in ascending order.

Primary Descending Sort

Dalam

The next example demonstrates how to use the Order By Descending clause in a LINQ query to sort the strings by their first letter, in descending order.

Contoh Coding Visual Basic

Secondary Sort Examples

Coding

Secondary Ascending Sort

The following example demonstrates how to use the Order By clause in a LINQ query to perform a primary and secondary sort of the strings in an array. The strings are sorted primarily by length and secondarily by the first letter of the string, both in ascending order.

Secondary Descending Sort

The next example demonstrates how to use the Order By Descending clause in a LINQ query to perform a primary sort, in ascending order, and a secondary sort, in descending order. The strings are sorted primarily by length and secondarily by the first letter of the string.

See also

Contoh Coding Visual Basic Practice

Welcome to the Visual Basic tutorial. Visual Basic (or VB) is a programming language developed by Microsoft that runs on the .Net Framework. With Visual Basic you can build Windows applications, web applications and Windows phone applications. Programs developed in Visual Basic will only run on a Windows Operating System. Visual Basic is easy to learn, fun and powerful!

The current tutorials are all tested with Visual Studio 2010 / 12 and use the .NetFramework 4. Version 4.5 will be able to support .NetFramework 4.

Contoh coding array multidimensi dalam visual basic

Contoh Coding Visual Basic Coding

These tutorials were written in .Net Framework 4.0.