AdgDataSet class | QSYS API Reference Guide

Estimated reading time: 5 minutes

A DataGate-compatible DataSet class for record-oriented database access.

Namespace: ASNA.DataGate.Client Assembly: ASNA.QSys.DataGate.Client.dll

Inheritance: Object –> MarshalByValueComponent –> DataSet

Thread Safety

Any public static (Shared) members of this type are safe for multithreaded operations.

Any instance members are not guaranteed to be thread safe.

Constructors

Name Description
AdgDataSet(String) Initializes a new instance of the class with the specified name.

For detailed constructor documentation, see AdgDataSet Constructors.

Properties

Type Name Description
DataRow ActiveRow Gets the active row in the DataTable associated with the current format index.
Int32 Count Gets the number of AdgTable instances in the AdgDataSet.
Int32 CurrentFormatIndex Gets the current format index used in the dataset.
String CurrentFormatName Gets the name of the current format used in the dataset.
IEnumerable<Byte[]> FormatIdentifiers Gets the format identifiers used in the dataset.
Int32 Formats Gets the number of formats used in the dataset.
ICollection<Int32> IntKeys Gets the collection of format indices in the AdgDataSet.
Boolean IsReadOnly Gets a value indicating whether the AdgDataSet is read-only.
AdgTable Item Gets the AdgTable instance associated with the specified format index.
AdgTable Item Gets the AdgTable instance associated with the specified format index.
AdgTable Item Gets the AdgTable instance associated with the specified format name.
AdgTable Item Gets the AdgTable instance associated with the specified format name.
Dictionary<Int32, AdgTable> m_adgTables A dictionary of AdgTable instances used in the dataset.
String[] m_aFormatStrings An array of format strings used in the dataset.
DataTable[] m_aKeyTablesTemplates An array of DataTable templates used for key tables in the dataset.
ICollection<String> StringKeys Gets the collection of format names in the AdgDataSet.
ICollection<AdgTable> Values Gets the collection of AdgTable instances in the AdgDataSet.

Methods

Signature Description
AddPreparedRowAndSetActive(Int32) Adds a prepared row to the DataTable associated with the specified format index and sets it as the active row.
AddRow(String) Adds a new row to the DataTable associated with the specified format name.
AddRow(Int32) Adds a new row to the DataTable associated with the specified format index.
Contains(KeyValuePair<Int32, AdgTable>) Determines whether the AdgDataSet contains a specific key-value pair.
ContainsKey(Int32) Determines whether the AdgDataSet contains an AdgTable with the specified format index.
CopyTo(KeyValuePair`2[], Int32) Copies the elements of the AdgDataSet to an array, starting at a particular array index.
DeleteRow(String, Int32) Deletes the row at the specified relative record number (rrn) in the DataTable associated with the specified format name.
GetEnumerator() Returns an enumerator that iterates through the AdgDataSet.
GetFormatIndex(String) Retrieves the format index associated with the specified format name.
GetFormatName(Int32) Retrieves the format name associated with the specified format index.
GetFormatTable(Int32) Retrieves the DataTable associated with the specified format index.
GetFormatTable(String) Retrieves the DataTable associated with the specified format name.
Initialize() Initializes the instance of the class.
InitializeCommon() Initializes common elements of the instance.
InitializeFormats() Initializes the format strings of the instance.
InsertRow(String, Int32) Inserts a new row at the specified relative record number (rrn) in the DataTable associated with the specified format name.
InsertRow(Int32, Int32) Inserts a new row at the specified relative record number (rrn) in the DataTable associated with the specified format index.
NewKeyTable(Int32) Creates a new AdgKeyTable for the DataTable associated with the specified format index.
NewKeyTable(String) Creates a new AdgKeyTable for the DataTable associated with the specified format name.
PrepareRow(String) Prepares a new row for the DataTable associated with the specified format name.
PrepareRow(String, DataRow) Prepares the specified row for the DataTable associated with the specified format name.
PrepareRow(Int32) Prepares a new row for the DataTable associated with the specified format index.
SetActive(Int32, Int32) Sets the active row to the row at the specified relative record number (rrn) in the DataTable associated with the specified format index.
SetActive(String, Int32) Sets the active row to the row at the specified relative record number (rrn) in the DataTable associated with the specified format name.

Example 1. NewKeyTable method example.

/* This example will open a file and find the record for
     the customer "Thilmany of Bread Co Resources".
     It omits error trapping for clearity's sake. */

  AdgConnection db = createAdgConnection("MyLocalDB");
  db.Open();
  FileAdapter file = new FileAdapter(db);
  file.FileName = "Examples//CMastNewL2";
  AdgDataSet dataSet;
  file.OpenNewAdgDataSet( out dataSet );

  //This next line creates a key based on record format RCMMastL2
  AdgKeyTable key = dataSet.NewKeyTable("RCMMastL2");

  //We specifiy KeyPartCount to avoid specifiying the second
  //key field.
  //We then set the keyfield "CMName" to our search argument.
  key.KeyPartCount = 1;
  key.Row["CMName"] = "Thilmany Of Bread Co Resources";

  //The following read will find the record associated with the 
  //customer name "Thilmany Of Bread Co Resources" and store it
  //in dataSet.
  file.ReadRandomKey(dataSet, ReadRandomMode.Equal, LockRequest.Default, key);</pre>

See AdgConnection Example for an implementation of createAdgConnection()