¶ÁÈ¡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
Ïà¹ØÎĵµ£º
Òª»ñµÃÕýÔÚÔËÐеÄSQL Server 2005µÄ°æ±¾ºÅ£¬¿Éͨ¹ýSQL Server Management StudioÁ¬½Óµ½¸Ã·þÎñÆ÷£¬È»ºóÔËÐÐÒÔÏÂSQLÓï¾ä£º
SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')
Ðк󣬿ɵõ½ÐèÒªµÄ°æ±¾ÐÅÏ¢£¬ÀýÈçÔÚÎҵĻúÆ÷ÉÏÔËÐкóµÃµ ......
ÔÖ· http://technet.microsoft.com/ja-jp/library/cc411406.aspx
¿´ÁËһƪSQL2005¹ØÓÚTransact-SQLµÄÇ¿»¯¼¼ÄܵĽéÉÜ£¬¾õµÃºÜÓÐÓô¦£¬¼òµ¥×ܽáÁËһϡ£
£¨Ò»£©Êý¾Ý¿â×ö³É
USE tempdb – »òÕßн¨Ò»¸öDB
CREATE TABLE SpeakerStats
(
speaker &n ......
ºÜ¶àʱºò£¬ÎÒÃÇ¿ÉÄÜÏ£Íû°´Ô¡¢°´Ìì¡¢°´Äê×öһЩÊý¾Ýͳ¼Æ£¬µ«ÊÇ£¬ÎÒÃÇʵ¼Ê±£´æµÄÊý¾Ý¿ÉÄÜÊÇÒ»¸öºÜ¾«È·µÄ·¢Éúʱ¼ä£¬¿ÉÄÜÊǵ½Ãë¡£ÈçºÎ¸ù¾ÝÒ»¸öʱ¼äÖ®½ØÈ¡ÆäÖеÄÒ»²¿·Ö¾Í³ÉÁËÎÊÌâ¡£
ÓÐÁ½¸ö½â¾ö·½·¨£º
×îÖ±½ÓµÄÏë·¨ÀûÓÃDatePart»òÕßYear¡¢Month¡¢Dayº¯Êý
CAST(
(
STR( Y ......
et ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER function [dbo].[Get_StrArrayLength]
(
@str varchar(1024), --Òª·Ö¸îµÄ×Ö·û´®
@split varchar(10) --·Ö¸ô·ûºÅ
)
returns int
as
begin
declare @location int
declare @start int
declare @length int
&nbs ......