Click or drag to resize
RunMaxRecordId Method
Gets the max record Id for the table or the where.

Namespace:  Biolomics.BioCallback
Assembly:  Biolomics.BioCallback (in Biolomics.BioCallback.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public static int MaxRecordId(
	long p_TableKey,
	XWhere p_Where = null
)

Parameters

p_TableKey
Type: SystemInt64
The table key to be used.
p_Where (Optional)
Type: Biolomics.SharedClassesXWhere
[Optional]The XWhere statement ,if given the returned value will be get from xwhere result.

Return Value

Type: Int32
Max record id
Examples
To get the greate record ID of all records respecting a query, use such a code:
Example VB.Net
Imports System
Imports BioloMICS.BioCallback
Imports BioloMICS.SharedClasses

Public Class Program

    <STAThread()>
    Shared Sub Main()
        Dim program As New Program
        program.Test()

    End Sub

    '    Write sub functions here
    Public Sub Test()
        '    get the current connection
        Dim SqlCo As XConnection = Run.GetCurrentConnection()
        If SqlCo Is Nothing Then
            Return
        End If

        '    get the current layout
        Dim Layout As XDataLayout = Run.GetCurrentLayout()
        If Layout Is Nothing Then  '    no current layout in a search page
            Return
        End If

        '    get the current table 
        Dim TableDef As XTableDef = SqlCo.GetTableDef(Layout.TableKey)
        If TableDef Is Nothing Then   '    should never happen
            Return
        End If

        '    get the max record ID of all records with a name starting with "candida"
        Dim MaxId As Integer = Run.MaxRecordId(TableDef.Key, XWhere.StartWith("Name", "candida"))
        '    write the result
        Console.Write("Name of record #" & MaxId.ToString & " starts with 'candida'")

    End Sub

End Class
See Also