ADODataSet.FieldValues


public property FieldValues

Prototype:

Read property FieldValues [ArrayList]

Description:

With this property you have access to the result of an executed query. You can set the query using the CommandText property, execute it with ExecuteQuery or ExecuteNonQuery and then acces the results via FieldValues.

ArrayList is an internal class with behavior similar to the Concept arrays. The only difference is that in its internal representation is more like a simple linked dynamic list. This class is not documented and is not intended to be directly used. The only member that should be used is the [] operator for accessing the records in the set.

Return value:

Returns an ArrayList encapsulating the ADODataRecords. Also, you must apply the index operator to return an exact ADODataRecord specified by the name of the column or by its index.

Example
		var Connection=new ADOConnection();
		var DataSet=new ADODataSet(Connection);

		// Check the Open member of the ADOConnection for connection strings
		Connection.Open(CONNECTION_STRING);
		// select query can be something like "select * from sysobjects"
		DataSet.CommandText=SELECT_QUERY;
		DataSet.ExecuteQuery();

		if (DataSet.First()) {
			echo DataSet.FieldValues["field_name"].ToString();
			// you can also use an index instead of a key (exactly as Concept arrays)
			// this will print the second record in the data set. The first one has 0 as an index.
			echo DataSet.FieldValues[1].ToString();
		}

		// closing connection
		Connection.Close();
		// printing erros (if any)
		echo Connection.LastError();