2460
Comment:
|
2482
|
Deletions are marked like this. | Additions are marked like this. |
Line 49: | Line 49: |
CategoryDyalogDotNetUtilities | ---- CategoryDyalogDotNetUtilities CategoryDyalog |
netDataTable
Overview
netDataTable is a Dyalog namespace of methods with the basic functions to create, modify and store such DataTable. A .Net DataTable is used to store tabular data in memory. Each column must be of the same type (all characters, all numbers, etc.). The DataTable is an important tool to share large quantity of APL data with .Net controls like a Grid, Chart or a ListView.
To Create a DataTable
dt ← AplToDT apl ⍝ returns a DataTable from Apl data apl ← DTtoApl dt ⍝ returns the Apl data from a DataTable ShowDT dt ⍝ show the DataTable in a Syncfusion DataGrid
To Modify a DataTable
dt AddRow apl ⍝ Add a Row at the end of a DataTable dt GetCol colNumber ⍝ Get the values of a single column of a DataTable GetColumnNames dt ⍝ Get the names of all the columns dt GetRow rowNumber ⍝ Get the values of a single row of a DataTable (dt rowNumber) InsertRow apl ⍝ Insert a new Row in a DataTable (dt rowNumber) SetRow apl ⍝ Update the values of a row in a DataTable
To Save a DataTable
xmlDoc ← DTtoXml dt ⍝ Xml representation of a Data Table dt ← XmlToDT xmlDoc ⍝ DataTable from an XmlDoc made with DTtoXml dt DTtoXmlFile fileName ⍝ Saves an Xml representation of the DataTable to a file name dt ← XmlFileToDT fileName ⍝ Retrieves a DataTable from an Xml representation made by DTtoXmlFile dt DTtoBinFile fileName ⍝ Saves a Binary representation of the DataTable to a file name dt ← BinFileToDT fileName ⍝ Retrieves a DataTable from a Binary representation made by DTtoBinFile
The namespace ../sfExcel could be used also to save, modify and retrieve a DataTable using an Excel file.
How to install netDataTable in your workspace
Download netDataTable.v1.0.txt
- Do a Select all (Ctrl+A) and a copy (Ctrl+C).
In your workspace execute )ed ⍟ netDataTable
- Paste (Ctrl+V) the text into the Dyalog editor
- Press Escape and ')save' your workspace
Version Information
Original author: |
Pierre Gilbert |
Responsible: |
|
Email: |
<apgil AT SPAMFREE videotron DOT ca> |