Posts

Showing posts from September, 2018

Setting up data set and display it

Before we display some data in DataGridView control in Visual Basic window we must create a data set. Data Set is an object that can hold data tables where all the data is stored in rows and columns. the first step is to create a table. Dim  dataTableObjectName as DataTable = New DataTable(tableName) this will create a table which is reference using the dataTableObjectName Example Dim userTable As DataTable = New DataTable("Users") Next step is adding columns to the table Dim column as DataColumn dataTableObjectName.Columns.Add (columnName, columnType) Example userTable.Columns.Add("userID", Type.GetType("System.Int.32")) ' adding second and third column userTable.Columns.Add("userName", Type.GetType("System.String")) userTable.Columns.Add("userContact", Type.GetType("System.String")) once we we columns in the table we can add row The rows contains records or the data for each user. dat

VB.net

a quick and convenient way to build a window based application. basically there is two main components in VB, the design view where we place the controls on a window form. then we have the code view where we write implementation for each controls on the form. Typically the control implementation or procedures are executed when certain events happens to the controls. Events like mouse click, or value change on text box, form load, form close and so on. After working with programming language like C, C++ and Java, getting use to VB is a bit challenging. its because first of all, VB don't use curly bracket to specify code blocks, and the statements don't end with semicolon. variable declaration for example is written as dim age As Integer in C, C++ and Java it written int age; in VB, variable declaration start with dim keyword, it means dimension and the functions are written as Function addNumber(ByVal num1 As Integer, ByVal num2 As Integer) As Integer addNumber

Popular posts from this blog

Drawing Simple Pie Chart

VB.net connecting to SQL Server

VB.net