ilovevbsomuchimmad
Programmer
Hi, I have the following coding which shows data from a database. However throughout the form the number in Textbox1 Changes, when I exit the program and re-load the program the quantity number does not change. The coding I have used is:
visual basic codeim connStr As String = _
"Provider = Microsoft.Jet.OLEDB.4.0;" & _
"Data Source = C:\Documents and Settings\Frank\Desktop\Equipment.mdb"
Dim sqlCommand As String = "SELECT * FROM Items"
Dim Equipmentconnector As New OleDb.OleDbConnection(connStr)
Dim Equipmentadapter As New OleDb.OleDbDataAdapter(sqlCommand, Equipmentconnector)
Dim oDatatable As New DataTable
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Equipmentadapter.Fill(oDatatable)
TextBox1.Clear()
TextBox3.DataBindings.Add("Text", oDatatable, "ItemDescription")
ListBox1.DataSource = oDatatable
ListBox1.DisplayMember = "ItemDescription"
TextBox1.DataBindings.Add("Text", oDatatable, "CurrentQuantity")
If somebody could help me on the coding to actually save the "Current Quantity" in the database, I would appreciate it.
Thanks
visual basic codeim connStr As String = _
"Provider = Microsoft.Jet.OLEDB.4.0;" & _
"Data Source = C:\Documents and Settings\Frank\Desktop\Equipment.mdb"
Dim sqlCommand As String = "SELECT * FROM Items"
Dim Equipmentconnector As New OleDb.OleDbConnection(connStr)
Dim Equipmentadapter As New OleDb.OleDbDataAdapter(sqlCommand, Equipmentconnector)
Dim oDatatable As New DataTable
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Equipmentadapter.Fill(oDatatable)
TextBox1.Clear()
TextBox3.DataBindings.Add("Text", oDatatable, "ItemDescription")
ListBox1.DataSource = oDatatable
ListBox1.DisplayMember = "ItemDescription"
TextBox1.DataBindings.Add("Text", oDatatable, "CurrentQuantity")
If somebody could help me on the coding to actually save the "Current Quantity" in the database, I would appreciate it.
Thanks