i have a listbox with more than one record, 2 textbox
i want to insert the data from all 3 objects in the sql table but with the below code i am not able to insert it.
eg suppose i have 2 names in listbox1 , name1, name 2 & in first textbox A & second textbox "1"
against both the names the data of text box shld be insetred
eg
i want to insert the data from all 3 objects in the sql table but with the below code i am not able to insert it.
eg suppose i have 2 names in listbox1 , name1, name 2 & in first textbox A & second textbox "1"
against both the names the data of text box shld be insetred
eg
VB.NET:
A name1 1
A name2 1
VB.NET:
For i = 1 To ListBox1.Items.Count
If ListBox1.Items(i - 1).selected = True Then
strqry = "insert into trans(cid,pid,lid) values('" & textBox1.Text & "','" & ListBox1.Items(i - 1) & "','" & textBox2.Text & "')"
cmd.CommandText = strqry
cmd.ExecuteNonQuery()
end if
next