Vb.net Billing Software Source Code πŸ†“ πŸ”–

Private Function GetProductPrice(productID As Integer) As Decimal Dim query As String = "SELECT Price FROM Products WHERE ProductID = @pid" Using conn As New OleDbConnection(connString) Dim cmd As New OleDbCommand(query, conn) cmd.Parameters.AddWithValue("@pid", productID) conn.Open() Return CDec(cmd.ExecuteScalar()) End Using End Function

ProductID (AutoNumber, PK) ProductName (Text) HSN (Text) Price (Currency) vb.net billing software source code

Private Sub ResetBill() txtCustomerName.Clear() txtMobile.Clear() txtGSTIN.Clear() dgvItems.Rows.Clear() nudQuantity.Value = 1 lblSubtotal.Text = "0.00" lblTax.Text = "0.00" lblDiscount.Text = "0.00" lblGrandTotal.Text = "0.00" currentBillID = -1 btnPrint.Enabled = False End Sub End Class Imports System.Drawing.Printing Public Class frmPrintPreview Private billID As Integer Private billData As DataTable Private itemsData As DataTable vb.net billing software source code

' Connection string for MS Access (change path accordingly) Dim connString As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\BillingDB.accdb" Dim currentBillID As Integer = -1 vb.net billing software source code

BillID (AutoNumber, PK) BillDate (Date/Time) CustomerID (Number) Subtotal (Currency) TaxAmount (Currency) DiscountAmount (Currency) GrandTotal (Currency)

Private Sub CalculateTotals() Dim subtotal As Decimal = 0 For Each row As DataGridViewRow In dgvItems.Rows If Not row.IsNewRow Then subtotal += CDec(row.Cells("colTotal").Value) End If Next