0
我试图将列表框中的数据列表作为批量数据保存到sql server中,但我不知道。 这是我的代码:如何在sql-server中的表格单元格中插入列表框数据作为一个批量数据
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()
的科目名称坐着和家人暂时存储在表盒中作为一个数据的表格单元格中插入。 但我不知道如何将整个列表框数据存储在表格单元格中。有任何想法吗。提前欣赏。
你想保存listbox的所有值吗? – hdkhardik