Differences between revisions 4 and 6 (spanning 2 versions)
Revision 4 as of 2015-03-09 15:22:13
Size: 2460
Comment:
Revision 6 as of 2015-04-05 00:16:57
Size: 2482
Comment:
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

  1. Download netDataTable.v1.0.txt

  2. Do a Select all (Ctrl+A) and a copy (Ctrl+C).
  3. In your workspace execute )ed ⍟ netDataTable

  4. Paste (Ctrl+V) the text into the Dyalog editor
  5. Press Escape and ')save' your workspace

Version Information

Original author:

Pierre Gilbert

Responsible:

PierreGilbert

Email:

<apgil AT SPAMFREE videotron DOT ca>


CategoryDyalogDotNetUtilities CategoryDyalog

netDataTable (last edited 2016-08-25 01:00:24 by PierreGilbert)