I am doing a project in vb.net and I've made a table with listview now the problem is that I am not be able to get a specific column item and only be able to get the item of first column (listview.selecteditems(0).text
) and i.e. 0(zero)... ListView1.SelectedItems(1/2/3/so on).Text
is not working.
My code is:
s = one_way.ListView1.SelectedItems(4).Text
cmd1 = New OleDbCommand("Select reference_no from Booking_Details", cn)
cmd1 = New OleDbCommand("insert into Booking_Details values(" & i & ",'" & one_way.ListView1.SelectedItems(0).Text & "','" & main.ComboBox1.Text & "','" & main.ComboBox9.Text & "','" & main.RadioButton2.Text & "','" & main.ComboBox2.Text & "','" & main.ComboBox4.Text & "','" & main.DateTimePicker2.Text & "','" & s & "',' ',' ','" & main.ComboBox5.Text & "','" & main.ComboBox6.Text & "','" & main.ComboBox7.Text & "')", cn)
cmd1.ExecuteNonQuery()
s = one_way.ListView1.SelectedItems(4).Text
cmd1 = New OleDbCommand("Select reference_no from Booking_Details", cn)
cmd1 = New OleDbCommand("insert into Booking_Details values('" & s & "')", cn)
cmd1.ExecuteNonQuery()
Someone please help.