Collapse All Expand All Language Filter: Code: All Code: Multiple Code: Visual Basic Code: C# Code: Visual C++ Code: J# Code: JScript

EDKB12WS Reference
clsPartner.SelectOne Method
See Also

Namespace: EDKB12WS.edokadb
Assembly: EDKB12WS (in EDKB12WS.exe)

# Syntax

Visual Basic
Public Overrides Function SelectOne() As DataTable
C#
public override DataTable SelectOne()
C++
public: DataTable^ SelectOne()
JScript
public function SelectOne() : DataTable;

# Source code

Visual Basic | Copy Code
Overrides Public Function SelectOne() As DataTable Dim scmCmdToExecute As SqlCommand = New SqlCommand() scmCmdToExecute.CommandText = "dbo.[pr_Partner_SelectOne]" scmCmdToExecute.CommandType = CommandType.StoredProcedure Dim dtToReturn As DataTable = new DataTable("Partner") Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute) ' // Use base class' connection object scmCmdToExecute.Connection = m_scoMainConnection Try scmCmdToExecute.Parameters.Add(new SqlParameter("@iNRPAR00", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iNRPAR00)) 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_Partner_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString()) End If If dtToReturn.Rows.Count > 0 Then If dtToReturn.Rows(0)("IDMSG00") Is System.DBNull.Value Then m_sIDMSG00 = SqlString.Null Else m_sIDMSG00 = New SqlString(CType(dtToReturn.Rows(0)("IDMSG00"), String)) End If If dtToReturn.Rows(0)("DMMSG00") Is System.DBNull.Value Then m_sDMMSG00 = SqlString.Null Else m_sDMMSG00 = New SqlString(CType(dtToReturn.Rows(0)("DMMSG00"), String)) End If If dtToReturn.Rows(0)("ZTMSG00") Is System.DBNull.Value Then m_sZTMSG00 = SqlString.Null Else m_sZTMSG00 = New SqlString(CType(dtToReturn.Rows(0)("ZTMSG00"), String)) End If If dtToReturn.Rows(0)("BEPGM00") Is System.DBNull.Value Then m_sBEPGM00 = SqlString.Null Else m_sBEPGM00 = New SqlString(CType(dtToReturn.Rows(0)("BEPGM00"), String)) End If If dtToReturn.Rows(0)("CDBNK00") Is System.DBNull.Value Then m_sCDBNK00 = SqlString.Null Else m_sCDBNK00 = New SqlString(CType(dtToReturn.Rows(0)("CDBNK00"), String)) End If m_iNRPAR00 = New SqlInt32(CType(dtToReturn.Rows(0)("NRPAR00"), Integer)) If dtToReturn.Rows(0)("BKPAR00") Is System.DBNull.Value Then m_sBKPAR00 = SqlString.Null Else m_sBKPAR00 = New SqlString(CType(dtToReturn.Rows(0)("BKPAR00"), String)) End If If dtToReturn.Rows(0)("NRFOG012") Is System.DBNull.Value Then m_iNRFOG012 = SqlInt32.Null Else m_iNRFOG012 = New SqlInt32(CType(dtToReturn.Rows(0)("NRFOG012"), Integer)) End If If dtToReturn.Rows(0)("BEBAN012") Is System.DBNull.Value Then m_sBEBAN012 = SqlString.Null Else m_sBEBAN012 = New SqlString(CType(dtToReturn.Rows(0)("BEBAN012"), String)) End If If dtToReturn.Rows(0)("NRFOG022") Is System.DBNull.Value Then m_sNRFOG022 = SqlString.Null Else m_sNRFOG022 = New SqlString(CType(dtToReturn.Rows(0)("NRFOG022"), String)) End If If dtToReturn.Rows(0)("BEBAN022") Is System.DBNull.Value Then m_sBEBAN022 = SqlString.Null Else m_sBEBAN022 = New SqlString(CType(dtToReturn.Rows(0)("BEBAN022"), String)) End If If dtToReturn.Rows(0)("TXADZ012") Is System.DBNull.Value Then m_sTXADZ012 = SqlString.Null Else m_sTXADZ012 = New SqlString(CType(dtToReturn.Rows(0)("TXADZ012"), String)) End If If dtToReturn.Rows(0)("TXADZ022") Is System.DBNull.Value Then m_sTXADZ022 = SqlString.Null Else m_sTXADZ022 = New SqlString(CType(dtToReturn.Rows(0)("TXADZ022"), String)) End If If dtToReturn.Rows(0)("TXADZ032") Is System.DBNull.Value Then m_sTXADZ032 = SqlString.Null Else m_sTXADZ032 = New SqlString(CType(dtToReturn.Rows(0)("TXADZ032"), String)) End If If dtToReturn.Rows(0)("TXADZ042") Is System.DBNull.Value Then m_sTXADZ042 = SqlString.Null Else m_sTXADZ042 = New SqlString(CType(dtToReturn.Rows(0)("TXADZ042"), String)) End If If dtToReturn.Rows(0)("TXADZ052") Is System.DBNull.Value Then m_sTXADZ052 = SqlString.Null Else m_sTXADZ052 = New SqlString(CType(dtToReturn.Rows(0)("TXADZ052"), String)) End If If dtToReturn.Rows(0)("TXADZ062") Is System.DBNull.Value Then m_sTXADZ062 = SqlString.Null Else m_sTXADZ062 = New SqlString(CType(dtToReturn.Rows(0)("TXADZ062"), String)) End If If dtToReturn.Rows(0)("TXADZ072") Is System.DBNull.Value Then m_sTXADZ072 = SqlString.Null Else m_sTXADZ072 = New SqlString(CType(dtToReturn.Rows(0)("TXADZ072"), String)) End If If dtToReturn.Rows(0)("NRPARAD") Is System.DBNull.Value Then m_sNRPARAD = SqlString.Null Else m_sNRPARAD = New SqlString(CType(dtToReturn.Rows(0)("NRPARAD"), String)) End If If dtToReturn.Rows(0)("NRADR00") Is System.DBNull.Value Then m_sNRADR00 = SqlString.Null Else m_sNRADR00 = New SqlString(CType(dtToReturn.Rows(0)("NRADR00"), String)) End If If dtToReturn.Rows(0)("NRFOG011") Is System.DBNull.Value Then m_sNRFOG011 = SqlString.Null Else m_sNRFOG011 = New SqlString(CType(dtToReturn.Rows(0)("NRFOG011"), String)) End If If dtToReturn.Rows(0)("BEBAN011") Is System.DBNull.Value Then m_sBEBAN011 = SqlString.Null Else m_sBEBAN011 = New SqlString(CType(dtToReturn.Rows(0)("BEBAN011"), String)) End If If dtToReturn.Rows(0)("NRFOG21") Is System.DBNull.Value Then m_sNRFOG21 = SqlString.Null Else m_sNRFOG21 = New SqlString(CType(dtToReturn.Rows(0)("NRFOG21"), String)) End If If dtToReturn.Rows(0)("BEBAN21") Is System.DBNull.Value Then m_sBEBAN21 = SqlString.Null Else m_sBEBAN21 = New SqlString(CType(dtToReturn.Rows(0)("BEBAN21"), String)) End If If dtToReturn.Rows(0)("TXADZ011") Is System.DBNull.Value Then m_sTXADZ011 = SqlString.Null Else m_sTXADZ011 = New SqlString(CType(dtToReturn.Rows(0)("TXADZ011"), String)) End If If dtToReturn.Rows(0)("TXADZ021") Is System.DBNull.Value Then m_sTXADZ021 = SqlString.Null Else m_sTXADZ021 = New SqlString(CType(dtToReturn.Rows(0)("TXADZ021"), String)) End If If dtToReturn.Rows(0)("TXADZ031") Is System.DBNull.Value Then m_sTXADZ031 = SqlString.Null Else m_sTXADZ031 = New SqlString(CType(dtToReturn.Rows(0)("TXADZ031"), String)) End If If dtToReturn.Rows(0)("TXADZ041") Is System.DBNull.Value Then m_sTXADZ041 = SqlString.Null Else m_sTXADZ041 = New SqlString(CType(dtToReturn.Rows(0)("TXADZ041"), String)) End If If dtToReturn.Rows(0)("TXADZ051") Is System.DBNull.Value Then m_sTXADZ051 = SqlString.Null Else m_sTXADZ051 = New SqlString(CType(dtToReturn.Rows(0)("TXADZ051"), String)) End If If dtToReturn.Rows(0)("TXADZ061") Is System.DBNull.Value Then m_sTXADZ061 = SqlString.Null Else m_sTXADZ061 = New SqlString(CType(dtToReturn.Rows(0)("TXADZ061"), String)) End If If dtToReturn.Rows(0)("TXADZ071") Is System.DBNull.Value Then m_sTXADZ071 = SqlString.Null Else m_sTXADZ071 = New SqlString(CType(dtToReturn.Rows(0)("TXADZ071"), String)) End If If dtToReturn.Rows(0)("CDBAL00") Is System.DBNull.Value Then m_sCDBAL00 = SqlString.Null Else m_sCDBAL00 = New SqlString(CType(dtToReturn.Rows(0)("CDBAL00"), String)) End If If dtToReturn.Rows(0)("CDVIG00") Is System.DBNull.Value Then m_sCDVIG00 = SqlString.Null Else m_sCDVIG00 = New SqlString(CType(dtToReturn.Rows(0)("CDVIG00"), String)) End If If dtToReturn.Rows(0)("SAVRS00") Is System.DBNull.Value Then m_sSAVRS00 = SqlString.Null Else m_sSAVRS00 = New SqlString(CType(dtToReturn.Rows(0)("SAVRS00"), String)) End If If dtToReturn.Rows(0)("TSMUT00") Is System.DBNull.Value Then m_sTSMUT00 = SqlString.Null Else m_sTSMUT00 = New SqlString(CType(dtToReturn.Rows(0)("TSMUT00"), String)) End If If dtToReturn.Rows(0)("VDMUTER") Is System.DBNull.Value Then m_sVDMUTER = SqlString.Null Else m_sVDMUTER = New SqlString(CType(dtToReturn.Rows(0)("VDMUTER"), String)) End If If dtToReturn.Rows(0)("TXRes00") Is System.DBNull.Value Then m_sTXRes00 = SqlString.Null Else m_sTXRes00 = New SqlString(CType(dtToReturn.Rows(0)("TXRes00"), String)) End If m_bSaldiert = New SqlBoolean(CType(dtToReturn.Rows(0)("Saldiert"), Boolean)) If dtToReturn.Rows(0)("AZEPL00") Is System.DBNull.Value Then m_iAZEPL00 = SqlInt32.Null Else m_iAZEPL00 = New SqlInt32(CType(dtToReturn.Rows(0)("AZEPL00"), Integer)) End If m_bCDVSA00 = New SqlBoolean(CType(dtToReturn.Rows(0)("CDVSA00"), Boolean)) End If Return dtToReturn Catch ex As Exception ' // some error occured. Bubble it to caller and encapsulate Exception object Throw New Exception("clsPartner::SelectOne::Error occured.", ex) Finally If m_bMainConnectionIsCreatedLocal Then ' // Close connection. m_scoMainConnection.Close() End If scmCmdToExecute.Dispose() sdaAdapter.Dispose() End Try End Function

# Platforms

Windows 8, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2 The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

# Version Information

## .NET Framework Supported in: 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0 ## .NET Compact Framework Supported in: 3.5, 2.0, 1.0 ## XNA Framework Supported in: 3.0, 2.0, 1.0

# See Also

## Reference clsPartner Class clsPartner clsPartner Members EDKB12WS.edokadb Namespace