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

EDKB12WS Reference
clsMitarbeiter.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_mitarbeiter_SelectOne]" scmCmdToExecute.CommandType = CommandType.StoredProcedure Dim dtToReturn As DataTable = new DataTable("mitarbeiter") Dim sdaAdapter As SqlDataAdapter = new SqlDataAdapter(scmCmdToExecute) ' // Use base class' connection object scmCmdToExecute.Connection = m_scoMainConnection Try scmCmdToExecute.Parameters.Add(new SqlParameter("@imitarbeiternr", SqlDbType.Int, 4, ParameterDirection.Input, False, 10, 0, "", DataRowVersion.Proposed, m_iMitarbeiternr)) 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_mitarbeiter_SelectOne' reported the ErrorCode: " & m_iErrorCode.ToString()) End If If dtToReturn.Rows.Count > 0 Then m_iMitarbeiternr = New SqlInt32(CType(dtToReturn.Rows(0)("mitarbeiternr"), Integer)) If dtToReturn.Rows(0)("vorname") Is System.DBNull.Value Then m_sVorname = SqlString.Null Else m_sVorname = New SqlString(CType(dtToReturn.Rows(0)("vorname"), String)) End If If dtToReturn.Rows(0)("name") Is System.DBNull.Value Then m_sName = SqlString.Null Else m_sName = New SqlString(CType(dtToReturn.Rows(0)("name"), String)) End If If dtToReturn.Rows(0)("kurzzeichen") Is System.DBNull.Value Then m_sKurzzeichen = SqlString.Null Else m_sKurzzeichen = New SqlString(CType(dtToReturn.Rows(0)("kurzzeichen"), String)) End If If dtToReturn.Rows(0)("anrede") Is System.DBNull.Value Then m_sAnrede = SqlString.Null Else m_sAnrede = New SqlString(CType(dtToReturn.Rows(0)("anrede"), String)) End If If dtToReturn.Rows(0)("tgnummer") Is System.DBNull.Value Then m_sTgnummer = SqlString.Null Else m_sTgnummer = New SqlString(CType(dtToReturn.Rows(0)("tgnummer"), String)) End If If dtToReturn.Rows(0)("email") Is System.DBNull.Value Then m_sEmail = SqlString.Null Else m_sEmail = New SqlString(CType(dtToReturn.Rows(0)("email"), String)) End If If dtToReturn.Rows(0)("fax") Is System.DBNull.Value Then m_sFax = SqlString.Null Else m_sFax = New SqlString(CType(dtToReturn.Rows(0)("fax"), String)) End If If dtToReturn.Rows(0)("telefon") Is System.DBNull.Value Then m_sTelefon = SqlString.Null Else m_sTelefon = New SqlString(CType(dtToReturn.Rows(0)("telefon"), String)) End If If dtToReturn.Rows(0)("unterschrift_text") Is System.DBNull.Value Then m_sUnterschrift_text = SqlString.Null Else m_sUnterschrift_text = New SqlString(CType(dtToReturn.Rows(0)("unterschrift_text"), String)) End If If dtToReturn.Rows(0)("funktionnr") Is System.DBNull.Value Then m_iFunktionnr = SqlInt32.Null Else m_iFunktionnr = New SqlInt32(CType(dtToReturn.Rows(0)("funktionnr"), Integer)) End If If dtToReturn.Rows(0)("sprache") Is System.DBNull.Value Then m_iSprache = SqlInt32.Null Else m_iSprache = New SqlInt32(CType(dtToReturn.Rows(0)("sprache"), Integer)) End If m_iFuermandant = New SqlInt32(CType(dtToReturn.Rows(0)("fuermandant"), Integer)) m_bShowtip = New SqlBoolean(CType(dtToReturn.Rows(0)("showtip"), Boolean)) m_iPartnernr = New SqlInt32(CType(dtToReturn.Rows(0)("partnernr"), Integer)) If dtToReturn.Rows(0)("mandantnr") Is System.DBNull.Value Then m_iMandantnr = SqlInt32.Null Else m_iMandantnr = New SqlInt32(CType(dtToReturn.Rows(0)("mandantnr"), Integer)) End If If dtToReturn.Rows(0)("aktiv") Is System.DBNull.Value Then m_bAktiv = SqlBoolean.Null Else m_bAktiv = New SqlBoolean(CType(dtToReturn.Rows(0)("aktiv"), Boolean)) End If If dtToReturn.Rows(0)("erstellt_am") Is System.DBNull.Value Then m_daErstellt_am = SqlDateTime.Null Else m_daErstellt_am = New SqlDateTime(CType(dtToReturn.Rows(0)("erstellt_am"), Date)) End If If dtToReturn.Rows(0)("mutiert_am") Is System.DBNull.Value Then m_daMutiert_am = SqlDateTime.Null Else m_daMutiert_am = New SqlDateTime(CType(dtToReturn.Rows(0)("mutiert_am"), Date)) End If If dtToReturn.Rows(0)("mutierer") Is System.DBNull.Value Then m_iMutierer = SqlInt32.Null Else m_iMutierer = New SqlInt32(CType(dtToReturn.Rows(0)("mutierer"), Integer)) End If If dtToReturn.Rows(0)("Mailempfang") Is System.DBNull.Value Then m_bMailempfang = SqlBoolean.Null Else m_bMailempfang = New SqlBoolean(CType(dtToReturn.Rows(0)("Mailempfang"), Boolean)) End If If dtToReturn.Rows(0)("EdokaMesasge") Is System.DBNull.Value Then m_bEdokaMesasge = SqlBoolean.Null Else m_bEdokaMesasge = New SqlBoolean(CType(dtToReturn.Rows(0)("EdokaMesasge"), Boolean)) End If If dtToReturn.Rows(0)("funktion") Is System.DBNull.Value Then m_sFunktion = SqlString.Null Else m_sFunktion = New SqlString(CType(dtToReturn.Rows(0)("funktion"), String)) End If If dtToReturn.Rows(0)("MailDirektVersenden") Is System.DBNull.Value Then m_bMailDirektVersenden = SqlBoolean.Null Else m_bMailDirektVersenden = New SqlBoolean(CType(dtToReturn.Rows(0)("MailDirektVersenden"), Boolean)) End If If dtToReturn.Rows(0)("Rang") Is System.DBNull.Value Then m_sRang = SqlString.Null Else m_sRang = New SqlString(CType(dtToReturn.Rows(0)("Rang"), String)) End If If dtToReturn.Rows(0)("MailDokumentrueckgang") Is System.DBNull.Value Then m_bMailDokumentrueckgang = SqlBoolean.Null Else m_bMailDokumentrueckgang = New SqlBoolean(CType(dtToReturn.Rows(0)("MailDokumentrueckgang"), Boolean)) End If If dtToReturn.Rows(0)("klassifizierung") Is System.DBNull.Value Then m_iKlassifizierung = SqlInt32.Null Else m_iKlassifizierung = New SqlInt32(CType(dtToReturn.Rows(0)("klassifizierung"), Integer)) End If If dtToReturn.Rows(0)("edoka_mail") Is System.DBNull.Value Then m_bEdoka_mail = SqlBoolean.Null Else m_bEdoka_mail = New SqlBoolean(CType(dtToReturn.Rows(0)("edoka_mail"), Boolean)) End If If dtToReturn.Rows(0)("journalisierung") Is System.DBNull.Value Then m_bJournalisierung = SqlBoolean.Null Else m_bJournalisierung = New SqlBoolean(CType(dtToReturn.Rows(0)("journalisierung"), Boolean)) End If End If Return dtToReturn Catch ex As Exception ' // some error occured. Bubble it to caller and encapsulate Exception object Throw New Exception("clsMitarbeiter::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 clsMitarbeiter Class clsMitarbeiter clsMitarbeiter Members EDKB12WS.edokadb Namespace