VB.NET:
For i = 1 To ListBox1.Items.Count - 1
cstr1 = ListBox1.Text
strqry1 = "insert into trans(pid) values('" & cstr1 & "')"
MessageBox.Show(strqry1)
If ListBox1.GetSelected(i) = True Then
cmd.CommandText = strqry1
cmd.ExecuteNonQuery()
End If
Next
MessageBox.Show("Records added")
uisng the above code fr inserting multiple data from listbox to dtatabse
but only first record gets inserted
help appreciated