This method resets the current row pointer back to the first row


Namespace: rocketsoftware.MVSP
Assembly: RocketMVSP (in RocketMVSP.dll)

Syntax

Visual Basic (Declaration)
Public Function MVResultSetFirst() As Boolean
C#
public bool MVResultSetFirst()
C++
public:
 bool MVResultSetFirst() sealed 
J#
public bool MVResultSetFirst()
JScript
public  function MVResultSetFirst() : bool

Return Value

Returns True if the current row pointer has been moved back or False if the result set contains no records

Remarks



Example connects and executes a query to retrieve contactname and city from the CUSTOMERS file reading the first 5 rows twice.

 Copy Code
 Dim returncode as boolean
 Dim mvsp as new rocketsoftware.MVSP.Pick
 Dim txt as string 
 Dim first as boolean = False
 returncode = mvsp.Connect("localhost",9000,"dm","")
 If returncode = True then
    returncode = mvsp.Logto("MVDEMO","")
    If returncode = True then
       mvsp.ExecuteQuery("QUERY", "CUSTOMERS", "", "", "CONTACTNAME CITY", "")
       While mvsp.MVResultSetNext = True
          If mvsp.MVResultSetGetRow = 5 and first = False then
             returncode = mvsp.MVResultSetFirst ' Set back to first record
             first = True
          Else
             txt = mvsp.MVResultSetGetCurrentRow
             ListBox1.Items.Add(mvspf.Extract(txt, 1))
             ListBox2.Items.Add(mvspf.Extract(txt, 2))
          End if
       End While
    End if
 End if
 returncode = mvsp.CloseConnection()
 

See Also