【发布时间】:2012-08-01 01:14:42
【问题描述】:
好的...经过很多天的尝试,我别无选择,只能寻求帮助。我用谷歌搜索了我的小心脏,现在它把我带到了这里。请帮忙。
我从我的 MySQL 数据库服务器得到一个字符串。然后我将字符串拆分并放入一个数组中。
然后我检查我的复选框并查看其中的任何条目是否等于数组值。问题是,它不起作用,而且我这辈子都无法让它起作用。
这有点像我的模板,如果有人能帮我解决这个问题,我将不胜感激。
Using connection As New MySqlConnection("datasource = " + IPADDRESS + "; username = '" + USERNAME + "'; password='" + PASSWORD + "' ; database = '" + DBASE + "'")
Using Command As New MySqlCommand("SELECT * FROM hazinc WHERE title = '" + ListBox1.Text + "'", connection)
connection.Open()
'Command.ExecuteReader()
Using reader As MySqlDataReader = Command.ExecuteReader()
While reader.Read()
'TextBox2.Text = reader("title")
STRINGRR = reader("involved")
End While
Dim NEWSTRINGRR As String() = STRINGRR.Split(",")
Dim CC As Integer
CC = 0
For Each X In NEWSTRINGRR
For I = 0 To clbEmployees.Items.Count - 1
Try
If clbEmployees.Items(I).ToString() = NEWSTRINGRR(I).ToString() Then
SetItemChecked(I)
End If
Catch ex As Exception
' MsgBox(ex.ToString)
End Try
Next
Next
End Using
connection.Close()
End Using
End Using
有人吗?请问……?
【问题讨论】:
-
请把STRINGRR的内容和clbEmployees前3项的内容贴出来
标签: .net mysql vb.net checklistbox