从SQL Server数据库中将已检查的值检索到checkedListBox

这是将选中的项目添加到数据库中时的代码,数据类型为Bit

Dim command As SqlClient.SqlCommand = con.CreateCommand()
command.CommandText = "insert into tblactionTaken (A1,A2,A3,A4,A5,Idnum) values (@a1,@a2,@a3,@a4,@a5,@idnum)"

command.Parameters.AddWithValue("@a1",A1)
command.Parameters.AddWithValue("@a2",A2)
command.Parameters.AddWithValue("@a3",A3)
command.Parameters.AddWithValue("@a4",A4)
command.Parameters.AddWithValue("@a5",A5)
command.Parameters.AddWithValue("@idnum",Me.CCLA_File_NumberLabel2.Text)

command.ExecuteNonQuery()

如何从数据库中将其检索到checkedlistbox?例如,我在checkedlistbox中有5个复选框,然后选中了3个复选框。当我从数据库中检索数据时,这3个复选框应显示为选中状态,而另2个则为未选中状态。

abc12345687 回答:从SQL Server数据库中将已检查的值检索到checkedListBox

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3169331.html

大家都在问