读取SQL表生成TREEVIEW
Public Function GetDataTable()
Dim myComm As New SqlClient.SqlCommand("SELECT cauth_id,cauth_name,igrade,csupauth_id,csupauth_name from MAIN_TREE01 ", sqlconnection1)
Dim sdapt As New SqlClient.SqlDataAdapter(myComm)
Dim ds As New DataSet
sdapt.Fill(ds)
Return ds.Tables(0)
End Function
Private Sub GetTreeViewDataBound(ByVal nodes As TreeNodeCollection, ByVal csupauth_id As String, ByVal dt As DataTable)
Dim dr As DataRow
If (dt.Rows.Count > 0) Then
Dim node As TreeNode
Dim drs As DataRow() = dt.Select("csupauth_id='" + csupauth_id + "'")
For Each dr In drs
node = New TreeNode()
node.Text = dr(1).ToString()
node.Name = dr(0).ToString
nodes.Add(node)
GetTreeViewDataBound(node.Nodes, node.Name.Trim(), dt)
Next
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TreeView1.Nodes.Clear()
GetTreeViewDataBound(TreeView1.Nodes, "A", GetDataTable())
TreeView1.ExpandAll()
End Sub
相关文档:
系统环境:Windows 7
软件环境:Visual C++ 2008 SP1 +SQL Server 2005
本次目的:编写一个航空管理系统
这是数据库课程设计的成果,虽然成绩不佳,但是作为我用VC++ 以来编写的最大程序还是传到网上,以供参考。用VC++ 做数据库设计并不容易,但也不是不可能。以下是我的程序界面,后面 ......
错误如下:
Database character set (AL32UTF8) and Client character set (ZHS16GBK) are different.
Character set conversion may cause unexpected results.
Note: you can set the client character set through the NLS_LANG environment variable or the NLS_LANG registry key in
HKEY_LOCAL_MACHINE\SOFTWARE\ ......
Window 2003 SQL2000远程连接的问题解决办法2008年10月07日 星期二 15:31一 看ping 服务器IP能否ping通。
这个实际上是看和远程sql server 2000服务器的物理连接是否存在。如果不行,请检查网络,查看配置,当然得确保远程sql server 2000服务器的IP拼写正确。
二 在Dos或命令行下输入telnet 服务器IP 端口,看 ......
所谓天下大事,分久必合,合久必分,对于分区表而言也一样。前面我们介绍过如何删除(合并)分区表中的一个分区,下面我们介绍一下如何为分区表添加一个分区。
为分区表添加一个分区,这种情况是时常会
发生的。比如,最初在数据库设计时,只预计了存放3年的数据,可是到了第4天怎 ......