Hi every body,
I'm workin on a vb.net 2003 ,and on an Access db.
I've the table :"CarParts" has these columns(PartNo,PartName,Price)
and I've a question I hope someone could help me to solve it.
I've a checkedlistbox,and I binded it to (PartName)column .
when I check an item I want it name to be added to a textbox,and it's price to be added in another txtbox to do do the sum of all the checked items.then I would be able to save the whole selected items written in this textbox to save them in another column as a text(memo) and I want to get the sum of all the selected items in another column in another table.
I did it by usuing the checkbox tool and it succeeded,according to the next code:
if checkbox1.checked the
bmb.position=0
sum += Val(Label 1 .text)
textbox1.text & = " the car part name"
Here is my CheckedListBox code:
Thanx in advance..
I'm workin on a vb.net 2003 ,and on an Access db.
I've the table :"CarParts" has these columns(PartNo,PartName,Price)
and I've a question I hope someone could help me to solve it.
I've a checkedlistbox,and I binded it to (PartName)column .
when I check an item I want it name to be added to a textbox,and it's price to be added in another txtbox to do do the sum of all the checked items.then I would be able to save the whole selected items written in this textbox to save them in another column as a text(memo) and I want to get the sum of all the selected items in another column in another table.
I did it by usuing the checkbox tool and it succeeded,according to the next code:
if checkbox1.checked the
bmb.position=0
sum += Val(Label 1 .text)
textbox1.text & = " the car part name"
Here is my CheckedListBox code:
Code:
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Dim strcon As String
Try
strcon = " provider=microsoft.jet.oledb.4.0;data source=Cars.mdb "
Dim con As New OleDbConnection(strcon)
con.Open()
Dim adapter As New OleDbDataAdapter("select * from CarParts", con)
Dim cn As OleDbConnection = New OleDbConnection
Dim dset1 As New DataSet
Dim dt As New DataTable
adapter.Fill(dt)
CheckedListBox1.DataSource = dt
CheckedListBox1.DisplayMember = "PartName"
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
End Try
End Sub