Skip to main content

SUM QTY FROM DATATABLE VB.NET

Dim DTGakGeser, DTGeser As New DataTable
                                DTGakGeser.Columns.Add("COGAKGESER", GetType(String))
                                DTGakGeser.Columns.Add("QTYGAKGESER", GetType(Decimal))

                                DTGeser.Columns.Add("COGESER", GetType(String))
                                DTGeser.Columns.Add("QTYGESER", GetType(Decimal))


                                Dim tmpSUMGakGeser, tmpSUMGeser
                                If DTGakGeser.Rows.Count > 0 Then
                                    'SUM DATATABLE
                                    tmpSUMGakGeser = Convert.ToInt32(DTGakGeser.Compute("SUM(QTYGAKGESER)", String.Empty))
                                End If

                                If DTGeser.Rows.Count > 0 Then
                                    'SUM DATATABLE
                                                                tmpSUMGeser = Convert.ToInt32(DTGeser.Compute("SUM(QTYGESER)", String.Empty))

                                End If

Comments