allbluekos
allbluekos
2015-09-05 01:44

明明Treeview1有很多节点,但是跟踪代码却只有1个节点,为什么?

  • treeview

请各位大神帮忙,确定TREEVIEW1里面有很多节点,treeview1.nodes.count只有1个?图片说明 Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
mycn.ConnectionString = "Data Source=" & ControlC.TextBox2.Text & ";Initial Catalog=blue;uid=maseru;pwd=Wks123"
Dim i As Integer
For i = 1 To TreeView1.Nodes.Count - 1
Dim k1 As String = TreeView1.Nodes(i).Name
Dim TF As Boolean
If TreeView1.Nodes(i).Checked = True Then
TF = "1"
Else
TF = "0"
End If
Dim mycom As New SqlClient.SqlCommand
mycom.CommandText = "update PrivilegeUser set puTF =" & TF & " where puRID ='" & TextBox1.Text & "' and puPriID ='" & k1 & "' "
mycom.Connection = mycn
Try
mycn.Open()
Dim mysqlreader As Data.SqlClient.SqlDataReader = mycom.ExecuteReader
mycom.ExecuteNonQuery()

        Catch ex As Exception

        End Try
    Next
End Sub
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

2条回答