这是我的代码,我只能保存第一项。我需要将整个列表保存在一个数据库列中。提前感谢您的帮助。
Dim mysql As String = "UPDATE tbl_item SET my_item = (@myitems) WHERE id = '" & Label6.Text & "'"
Dim mycmd As New MySqlCommand(mysql, sConnection)
Dim values As New List(Of String)
values.Add(ListBox1.Items.Add(values))
Dim sqlParam As New MySqlParameter With {.ParameterName = "@myitems", .DbType = DbType.String}
mycmd.Parameters.Add(sqlParam)
Dim i As Integer
For i = 0 To values.Count - 1
sqlParam.Value = (ListBox1.Items(i) & ";")
mycmd.ExecuteNonQuery()
Next