How to Calculate Two Columns in DataGridView

Submitted by admin on

In my previous tutorial using DataGridView Control I explained on “How to Differentiate Two Cell Values in DataGridView Control”. This time I will teach you on how to calculate two columns in DataGridView Control.

This tutorial is very useful if you want to make a total of the two columns. For example a total of “Qty” and “Sales Price” Column.

Additionally, we will make a total of the “Amount” column.

Connect an OLEDB with MS Access 2007 Files

Submitted by bryanhayag on
Add a new module in you project or use the existing module... add a Reference" Microsoft ActiveX Data Objects 2.1 Library or Higher type this code in the Module and make Sub Main as your startup module Option Explicit Public CON as ADODB.Connection Sub Main() Set CON = New ADODB.Connection CON.Provider = "Microsoft.ACE.OLEDB.12.0"

SQL AND / OR Operator

Submitted by admin on

The AND/OR can be used to make a complex or multiple condition for the WHERE clause while selecting, updating or deleting some data.

The AND works as follows

Condition 1 AND condition 2 AND……… condition N

We can use as many conditions as we want with the AND. This condition’s result will only come out to be true if all the conditions are specifies, just like the and truth table

SQL DISTINCT Clause

Submitted by admin on

The SQL DISTINCT clause is also used in the SELECT statement, it is used to get the data and display the unique values, and the values will be shown no matter how many times they appear in the table.

DISTINCT Syntax

SELECT DISTINCT columnname FROM tablename

Users:

SQL ORDER BY Clause

Submitted by admin on

The ORDER BY clause is used in the SQL SELECT statement to order the data in ascending or descending order, this may help us get a better look when analyzing data, the ORDER BY clause can sort numeric as well as alphabetical data in both ascending and descending order.

SQL ORDER BY Clause Syntax

SQL GROUP BY Clause

Submitted by admin on

In the SQL SELECT Statement we can also group data upon certain conditions, the GROUP BY condition can only be applied if we have redundant values in at least one column upon which we can group things.

If every column of each row has unique value then the GROUP BY clause will not group any thing together and will not give proper results.

The GROUP BY clause also requires the use of an aggregate function, which does some mathematical calculations upon the grouped data.