Data Table Functions
These functions read and write individual cells in a DataTable or DataView, such as one returned by GetTable.
GetRowColumn
GetRowColumn(Data, Row, Column)
Returns the value of a specific cell in a DataTable or DataView.
| Parameter | Description |
|---|---|
Data |
A DataTable or DataView |
Row |
Zero-based row index |
Column |
Column name (String) or zero-based column index (Integer) |
Returns: Object
Examples:
Dim tbl = GetTable("SELECT * FROM Products")
Dim name = GetRowColumn(tbl, 0, "ProductName") ' first row, by name
Dim price = GetRowColumn(tbl, 0, 2) ' first row, column index 2
SetRowColumn
SetRowColumn(Data, Row, Column, Value)
Sets the value of a specific cell in a DataTable or DataView.
| Parameter | Description |
|---|---|
Data |
A DataTable or DataView |
Row |
Zero-based row index |
Column |
Column name (String) or zero-based column index (Integer) |
Value |
Value to write into the cell |
Returns: Boolean (True on success)
Examples:
Dim tbl = GetTable("SELECT * FROM Products")
SetRowColumn(tbl, 0, "Price", 19.99)
SetRowColumn(tbl, 0, 2, "Updated value")
Note:
SetRowColumnmodifies the in-memoryDataTable. It does not write changes back to the database.