[Visual Basic] Private Function Load_Treedata( _
ByVal Suchstring As String, _
ByVal nuraktive As Boolean, _
ByVal Archivobjekte As Boolean _
) As DataTable
[Visual Basic] Private Function Load_Treedata(ByVal Suchstring As String, ByVal nuraktive As Boolean, ByVal Archivobjekte 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_suche"
selectcommand.Parameters.Add("@Mitarbeiternr", SqlDbType.Int, 4)
selectcommand.Parameters.Add("@suchstring", SqlDbType.VarChar, 255)
selectcommand.Parameters.Add("@NurAktive", SqlDbType.Int, 4)
selectcommand.Parameters.Add("@arcobject", SqlDbType.Int, 4)
selectcommand.Parameters(0).Value = Globals.clsmitarbeiter.iMitarbeiternr.Value
selectcommand.Parameters(1).Value = Suchstring
If nuraktive = True Then
selectcommand.Parameters(2).Value = 1
Else
selectcommand.Parameters(2).Value = 0
End If
If Archivobjekte = True Then
selectcommand.Parameters(3).Value = 1
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