¶ÁÈ¡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
Ïà¹ØÎĵµ£º
´íÎóÈçÏ£º
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\ ......
Òª»ñµÃÕýÔÚÔËÐеÄSQL Server 2005µÄ°æ±¾ºÅ£¬¿Éͨ¹ýSQL Server Management StudioÁ¬½Óµ½¸Ã·þÎñÆ÷£¬È»ºóÔËÐÐÒÔÏÂSQLÓï¾ä£º
SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')
Ðк󣬿ɵõ½ÐèÒªµÄ°æ±¾ÐÅÏ¢£¬ÀýÈçÔÚÎҵĻúÆ÷ÉÏÔËÐкóµÃµ ......
Êý¾ÝѹËõ£¨Data Compression£©ÊÇSQL Server 2008ÒýÈëµÄÐÂÌØÐÔÖ®Ò»£¬ÕâÏî¼¼ÊõʹÊý¾Ý¸üÓÐЧµÄ±£´æ²¢ÇÒ¼«´ó¼õÉÙÁË´æ´¢¿ªÏú£¬Í¬Ê±Ò²´øÀ´ÁËÐÔÄÜÉϵÄÏÔÖøÌá¸ß£¬ÓÈÆäÊǶÔÐèÒª´óÁ¿´ÅÅÌI/OµÄÊý¾Ý²Ö¿â¡£
×¢£ºÆäʵÔÚSQL Server 2005 SP2°æ±¾ÖУ¬ÒѾÒýÈëÁË vardecimal £¬ËüʹÓñ䳤µÄ¸ñʽ´æ´¢¶¨³¤µÄdecimalºÍnumbericÊý¾Ý¡£
......
Select CONVERT(varchar(100), GETDATE(), 0): 05 16 2006 10:57AM
Select CONVERT(varchar(100), GETDATE(), 1): 05/16/06
Select CONVERT(varchar(100), GETDATE(), 2): 06.05.16
Select CONVERT(varchar(100), GETDATE(), 3): 16/05/06
Select CONVERT(varchar(100), GETDATE(), 4): 16.05.06
Select CONVERT(varch ......