' /////////////////////////////////////////////////////////////////////////// ' // Description: Data Access class for the table 'mandant' ' // Generated by LLBLGen v1.2.1045.38210 Final on: Samstag, 7. Dezember 2002, 21:32:49 ' // Because the Base Class already implements IDispose, this class doesn't. ' /////////////////////////////////////////////////////////////////////////// Imports System Imports System.Data Imports System.Data.SqlTypes Imports System.Data.SqlClient Namespace edokadb Public Class clsDomainTable Inherits clsDBInteractionBase Dim m_Tablename As String Dim m_Aktive As Integer Property Tablename() As String Get Return m_Tablename End Get Set(ByVal Value As String) m_Tablename = Value End Set End Property Property Aktive() As Boolean Get Return m_Aktive End Get Set(ByVal Value As Boolean) If Value = False Then m_Aktive = 0 Else m_Aktive = 1 End Set End Property Public Sub New() End Sub Public Overrides Function SelectAll() As DataTable Dim scmCmdToExecute As SqlCommand = New SqlCommand() scmCmdToExecute.CommandText = "dbo.[sp_get_Domaintable]" scmCmdToExecute.CommandType = CommandType.StoredProcedure Dim dtToReturn As DataTable = New DataTable("mandant") Dim sdaAdapter As SqlDataAdapter = New SqlDataAdapter(scmCmdToExecute) ' // Use base class' connection object scmCmdToExecute.Connection = m_scoMainConnection Try scmCmdToExecute.Parameters.Add(New SqlParameter("@Tablename", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 0, 0, "", DataRowVersion.Proposed, m_Tablename)) scmCmdToExecute.Parameters.Add(New SqlParameter("@Aktive", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_Aktive)) scmCmdToExecute.Parameters.Add(New SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode)) If m_bMainConnectionIsCreatedLocal Then ' // Open connection. m_scoMainConnection.Open() Else If m_cpMainConnectionProvider.bIsTransactionPending Then scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction End If End If ' // Execute query. sdaAdapter.Fill(dtToReturn) m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32)) If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then ' // Throw error. Throw New Exception("Stored Procedure 'pr_mandant_SelectAll' reported the ErrorCode: " & m_iErrorCode.ToString()) End If Return dtToReturn Catch ex As Exception ' // some error occured. Bubble it to caller and encapsulate Exception object Throw New Exception("clsDomainTable::SelectAll::Error occured.", ex) Finally If m_bMainConnectionIsCreatedLocal Then ' // Close connection. m_scoMainConnection.Close() End If scmCmdToExecute.Dispose() sdaAdapter.Dispose() End Try End Function End Class End Namespace