Private Sub S_PutValue(ByVal ds As DataSet)
' Get Each DataTable in the DataTableCollection and
' print each row value.
Dim intTotalRow As Integer = Me.dgv_Payment.RowCount - 2
Dim intTotalColumn As Integer = 7
Dim x As Integer = 0
Dim y As Integer = 0
For x = 0 To intTotalRow
Dim strSupplierRecord As DataRow = ds.Tables("tblPayment").NewRow()
y = 0
strSupplierRecord("Supplier_Code") = Me.dgv_Payment.Item(y, x).Value
y += 1
strSupplierRecord("Supllier_Name") = Me.dgv_Payment.Item(y, x).Value
y += 1
strSupplierRecord("Period") = Me.dgv_Payment.Item(y, x).Value
y += 1
strSupplierRecord("Sales_Of_Event") = CDbl(Me.dgv_Payment.Item(y, x).Value)
y += 1
strSupplierRecord("Haigac_Of_Event") = CDbl(Me.dgv_Payment.Item(y, x).Value)
y += 1
strSupplierRecord("Event_Rate") = CDbl(Me.dgv_Payment.Item(y, x).Value)
y += 1
strSupplierRecord("Consumption_Tax") = CDbl(Me.dgv_Payment.Item(y, x).Value)
y += 1
strSupplierRecord("Amount_Of_Money_Payment") = CDbl(Me.dgv_Payment.Item(y, x).Value)
ds.Tables("tblPayment").Rows.Add(strSupplierRecord)
Next
End Sub
Private Sub S_CreateTable(ByVal ds As DataSet)
Dim tblDS As DataTable = New DataTable("tblPayment")
tblDS.Columns.Add("Supplier_Code", Type.GetType("System.Int32"))
tblDS.Columns.Add("Supllier_Name", Type.GetType("System.String"))
tblDS.Columns.Add("Period", Type.GetType("System.Int32"))
tblDS.Columns.Add("Sales_Of_Event", Type.GetType("System.Int32"))
tblDS.Columns.Add("Haigac_Of_Event", Type.GetType("System.Int32"))
tblDS.Columns.Add("Event_Rate", Type.GetType("System.Int32"))
tblDS.Columns.Add("Consumption_Tax", Type.GetType("System.Int32"))
tblDS.Columns.Add("Amount_Of_Money_Payment", Type.GetType("System.Int32"))
ds.Tables.Add(tblDS)
End Sub