I'm trying to save list of data in listbox to the sql server as a bulk data but I don't have any idea. This is my code:
cmd As New SqlClient.SqlCommand("INSERT INTO tblStudentPersonalInformation(studentregistrationumber,studentname,studentgender,studentdob,studentpicture,studentntsubjectssat,studentfamilymembers,) VALUES('" & txtStudentRegistrationNumber.Text & "','" & txtStudentName.Text & "','" & cmbStudentGender.Text & "','"
& studentdob & "','" & "',@studentpicture,'" & lbStudentSubjectsSat.Text & lbStudenttFamilyMembers.Text & "')",
databaseconnection.cn)
cmd.Parameters.Add(New SqlClient.SqlParameter("@studentpicture", SqlDbType.Image)).Value = IO.File.ReadAllBytes(openfile.FileName)
i = cmd.ExecuteNonQuery()
The name of subjects sat and family members are temporarily stored in list-boxes to be inserted in the table cell as one data. But I don't know how to store the whole listbox data in the table cell. Any ideas. Appreciate in advance.