Treedaten ab Datenbank laden
[Visual Basic] Private Function Load_Treedata( _
ByVal nuraktive As Boolean _
) As DataTable
[Visual Basic] Private Function Load_Treedata(ByVal nuraktive As Boolean) As DataTable
Treedata.Tables.Clear()
Dim selectcommand As New SqlCommand
Dim connection As New SqlConnection()
Dim da As New SqlDataAdapter("", connection)
selectcommand.CommandText = "sp_get_applstruktur"
selectcommand.Parameters.Add("@Mitarbeiternr", SqlDbType.Int, 4)
selectcommand.Parameters.Add("@NurAktive", SqlDbType.Int, 4)
selectcommand.Parameters(0).Value = Globals.clsmitarbeiter.iMitarbeiternr.Value
If nuraktive = True Then
selectcommand.Parameters(1).Value = 1
Else
selectcommand.Parameters(1).Value = 0
End If
selectcommand.CommandType = CommandType.StoredProcedure
selectcommand.Connection = connection
Try
connection.ConnectionString = Globals.sConnectionString
connection.Open()
da.SelectCommand = selectcommand
da.Fill(Treedata, "Tree")
Catch ex As Exception
Finally
connection.Close()
da.Dispose()
selectcommand.Dispose()
End Try
End Function
Plattformen: Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition