Reads a record
Class EasycomDataSet
Syntax
public Boolean EasycomDataSet.ReadFirst()
public Boolean EasycomDataSet.ReadNext()
public Boolean EasycomDataSet.ReadPrev()
public Boolean EasycomDataSet.ReadLast()
Description
These functions are reading a record using the given direction. The function returns true if a record is fetched and false otherwise.
If the is an EasycomFile object, the fetched record may be locked or not depending on the current fetch mode. The fetch mode is sequential read with no lock by default and can be changed using the EasycomFile.SetFetchmode method.
The field values for the current record can be accessed using the GetValue function.
Example of use (C#)
EasycomConnection my_cnx;
EasycomFile my_file;
string result;
my_cnx = new EasycomConnection();
my_cnx.ConnectionString = "Server=194.206.160.111;User Id=
my_cnx.Open();
my_file = my_cnx.OpenFile("S_CUSTOMER");
my_file.ReadFirst();
result = my_file.GetValue("COMPANY").ToString() + " - "+ my_file.GetValue("FIRSTNAME").ToString();
MessageBox.Show("Customer found : "+result);
while (my_file.ReadNext())
{
result += my_file.GetValue(“COMPANY”).ToString() + “ – “ + my_file.GetValue(“FIRSTNAME”).ToString());
}
Example of use (VB.NET)
Dim my_cnx As EasycomConnection
Dim my_file As EasycomFile
Dim result As String
my_cnx = New EasycomConnection
my_cnx.ConnectionString = "Server=194.206.160.111;User Id=
my_cnx.Open()
my_file = my_cnx.OpenFile("S_CUSTOMER")
my_file.ReadFirst()
result = my_file.GetValue("COMPANY").ToString() + " - " + my_file.GetValue("FIRSTNAME").ToString()
MessageBox.Show("Customer found : " + result)
while (my_file.ReadNext())
{
result += my_file.GetValue(“COMPANY”).ToString() + “ – “ + my_file.GetValue(“FIRSTNAME”).ToString())
}
See also