i'm a newbie in programming vb.net, I'm making a simple point of sale I want to insert multiple rows of data from listview to linq to sql, here is the code:
Private Sub Save_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Save.Click
Dim db As New PenjualanDataContext
For Each item As ListViewItem In ListView1.SelectedItems
Dim TransaksiBaru As New Transaksi With {.Dibayar = Dibayar.Text, .Faktur = FakturTextBox.Text, .Harga = HargaComboBox.Text, .Jumlah = JumlahTextBox.Text, .Kembali = Kembali.Text, .Kode_Barang = Kode_BarangComboBox.Text, .Nama_Barang = Nama_BarangComboBox.Text, .SubTotal = SubTotalTextBox.Text, .Tanggal = TanggalDateTimePicker.Text, .Total = TotalTextBox.Text}
db.Transaksis.InsertOnSubmit(TransaksiBaru)
db.SubmitChanges()
Next
End Sub
I cannot save the data to linq to sql.....