clsMyKey_Tabelle.get_dbkey Method clsMyKey_Tabelle.get_dbkey Method EDKB12WS.edokadb.clsMyKey_Tabelle.get_dbkey Method get_dbkey Method topic_000000000000027A EDKB12WS.edokadb.clsMyKey_Tabelle.get_dbkey EDKB12WS.edokadb.clsMyKey_Tabelle.get_dbkey clsMyKey_Tabelle.get_dbkey EDKB12WS.edokadb.clsMyKey_Tabelle.clsMyKey_Tabelle.get_dbkey EDKB12WS.edokadb.clsMyKey_Tabelle.get_dbkey EDKB12WS (in EDKB12WS.exe) clsMyKey_Tabelle.get_dbkey Method EDKB12WS.edokadb.clsMyKey_Tabelle topic_000000000000027A
clsMyKey_Tabelle.get_dbkey Method
Namespace: EDKB12WS.edokadb
Assembly: EDKB12WS (in EDKB12WS.exe)
Visual Basic
Public Function get_dbkey( _
  ByVal Tablename As ]]>Stringa]]>]]> _
) As ]]>Longa]]>]]>
C#
public ]]>longa]]>]]> get_dbkey(
  ]]>stringa]]>]]> Tablename
)
C++
public:
]]>longa]]>]]> get_dbkey(
  ]]>Stringa]]>]]>^ Tablename
)
JScript
public function get_dbkey(
   Tablename : ]]>Stringa]]>]]>
) : ]]>longa]]>]]>;
ParametersTablename
$END-IFNOTEMPTY$
Visual Basic Copy CodeCopy Code ]]>
Public Function get_dbkey(ByVal Tablename As String) As Long
   Dim m_dbkey As Long
   Dim scmCmdToExecute As SqlCommand = New SqlCommand()
   scmCmdToExecute.CommandText = "dbo.[sp_get_dbkey]"
   scmCmdToExecute.CommandType = CommandType.StoredProcedure
   ' // 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, Tablename))
       scmCmdToExecute.Parameters.Add(New SqlParameter("@dbkey", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, m_dbkey))
       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.
       Try
           scmCmdToExecute.Connection.Open()
       Catch ex As Exception
       Finally
       End Try

       scmCmdToExecute.ExecuteNonQuery()
       m_dbkey = scmCmdToExecute.Parameters.Item("@dbkey").Value
       m_iErrorCode = New SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value, SqlInt32))
       scmCmdToExecute.Connection.Close()

       If Not m_iErrorCode.Equals(New SqlInt32(LLBLError.AllOk)) Then
           ' // Throw error.
           Throw New Exception("Stored Procedure 'sp_get_dbkey' reported the ErrorCode: " & m_iErrorCode.ToString())
       End If

       Return m_dbkey
   Catch ex As Exception
           ' // some error occured. Bubble it to caller and encapsulate Exception object
           Throw New Exception("clsKey_tabelle::get_dbkey::Error occured." + ex.Message, ex)
       Finally
           If m_bMainConnectionIsCreatedLocal Then
               ' // Close connection.
               m_scoMainConnection.Close()
           End If
           scmCmdToExecute.Dispose()
       End Try
End Function
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 Requirementsa]]>]]>.
.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
Reference clsMyKey_Tabelle ClassclsMyKey_Tabelle Class
clsMyKey_Tabelle clsMyKey_Tabelle MembersclsMyKey_Tabelle clsMyKey_Tabelle Members
EDKB12WS.edokadb NamespaceEDKB12WS.edokadb Namespace