[Visual Basic] Public Function Get_Stammdaten( _
ByVal Tabelle As String, _
ByVal orderby As String _
) As DataTable
[Visual Basic] Public Function Get_Stammdaten(ByVal Tabelle As String, ByVal orderby As String) As DataTable
Dim selectcommand As New SqlCommand
Dim connection As New SqlConnection()
Dim da As New SqlDataAdapter("", connection)
Dim ds As New DataSet
selectcommand.CommandText = "sp_get_stammdaten"
selectcommand.Parameters.Add("@Mitarbeiternr", SqlDbType.Int, 4)
selectcommand.Parameters.Add("@Tabelle", SqlDbType.VarChar, 255)
selectcommand.Parameters.Add("@Orderby", SqlDbType.VarChar, 255)
selectcommand.Parameters(0).Value = Globals.clsmitarbeiter.iMitarbeiternr.Value
selectcommand.Parameters(1).Value = Tabelle
selectcommand.Parameters(2).Value = orderby
selectcommand.CommandType = CommandType.StoredProcedure
selectcommand.Connection = connection
Try
connection.ConnectionString = Globals.sConnectionString
connection.Open()
da.SelectCommand = selectcommand
da.Fill(ds)
Return ds.Tables(0)
Catch ex As Exception
Finally
connection.Close()
da.Dispose()
ds.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