: Create unlimited professional invoices with unique reference numbers.
Private Sub btnSaveInvoice_Click(sender As Object, e As EventArgs) Handles btnSaveInvoice.Click Try Dim db As New dbConfig() db.OpenConnection() Dim cmd As New SqlCommand("INSERT INTO Invoices (CustomerName, InvoiceDate, TotalAmount) VALUES (@name, @date, @total)", db.conn) cmd.Parameters.AddWithValue("@name", txtCustomerName.Text) cmd.Parameters.AddWithValue("@date", DateTime.Now) cmd.Parameters.AddWithValue("@total", CDec(lblGrandTotal.Text)) cmd.ExecuteNonQuery() MsgBox("Invoice Saved Successfully!", MsgBoxStyle.Information) db.CloseConnection() Catch ex As Exception MsgBox(ex.Message) End Try End Sub Use code with caution. 7. Advanced Features to Add vb.net billing software source code
Public Class BillingSoftware Private Sub btnAddItem_Click(sender As Object, e As EventArgs) Handles btnAddItem.Click If txtItemName.Text <> "" AndAlso txtQuantity.Text <> "" AndAlso txtPrice.Text <> "" Then ListView1.Items.Add(txtItemName.Text) Dim lvItem As ListViewItem = ListView1.Items(ListView1.Items.Count - 1) lvItem.SubItems.Add(txtQuantity.Text) lvItem.SubItems.Add(txtPrice.Text) CalculateTotal() txtItemName.Clear() txtQuantity.Clear() txtPrice.Clear() txtItemName.Focus() Else MessageBox.Show("Please fill in all fields.") End If End Sub "" AndAlso txtQuantity.Text <
Most VB.NET billing systems use or MS Access for data storage. Use the following logic to connect your application to a SQL database: "" AndAlso txtPrice.Text <
' Update stock Dim updateStock As String = "UPDATE tbl_Product SET StockQuantity = StockQuantity - @qty WHERE ProductID = @pid" cmd = New SqlCommand(updateStock, conn, transaction) cmd.Parameters.AddWithValue("@qty", row.Cells("Quantity").Value) cmd.Parameters.AddWithValue("@pid", row.Cells("ProductID").Value) cmd.ExecuteNonQuery() Next
A standard VB.NET billing application typically utilizes a three-tier architecture to ensure scalability and maintainability: