Vertragsverwaltung-Klassenbibliothek  

clsApplikationInstallationAls.SelectAllWApplikationNrLogic -Methode

Purpose: Select method for a foreign key. This method will Select one or more rows from the database, based on the Foreign Key 'ApplikationNr'

[Visual Basic]
Public Function SelectAllWApplikationNrLogic() As DataTable

Rückgabewert

DataTable object if succeeded, otherwise an Exception is thrown.

Hinweise

Properties needed for this method: <UL> <LI>iApplikationNr. May be SqlInt32.Null</LI> </UL> Properties set after a succesful call of this method: <UL> <LI>iErrorCode</LI> </UL>

Quellcode

[Visual Basic]
		Public Function SelectAllWApplikationNrLogic() As DataTable 
Dim scmCmdToExecute As SqlCommand = New SqlCommand() 
scmCmdToExecute.CommandText = "dbo.[pr_ApplikationInstallationAls_SelectAllWApplikationNrLogic]" 
scmCmdToExecute.CommandType = CommandType.StoredProcedure 
Dim dtToReturn As DataTable = new DataTable("ApplikationInstallationAls") 
Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute) 
 
' // Use base class' connection object 
scmCmdToExecute.Connection = m_scoMainConnection 
 
Try 
scmCmdToExecute.Parameters.Add(new SqlParameter("@iApplikationNr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, m_iApplikationNr)) 
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_iApplikationNr = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iApplikationNr").Value, SqlInt32)) 
 
If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then 
' // Throw error. 
Throw New Exception("Stored Procedure 'pr_ApplikationInstallationAls_SelectAllWApplikationNrLogic' 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("clsApplikationInstallationAls::SelectAllWApplikationNrLogic::Error occured.", ex) 
Finally 
If m_bMainConnectionIsCreatedLocal Then 
' // Close connection. 
m_scoMainConnection.Close() 
End If 
scmCmdToExecute.Dispose() 
sdaAdapter.Dispose() 
End Try 
End Function

Forderungen

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

Siehe auch

clsApplikationInstallationAls