In case that you have a .net DataTable and you want to convert one column to Apl, this function taken from http://www.AplWiki.com/netDataTable may help you:(link corrected, thanks Kai)
apl←dt GetCol colNumber;colName;⎕USING;string;dv ⍝ Get the value of a single column of an existing DataTable ⍝ dt = Data Table ⍝ colNumber = Index of the column (Origin 1) ⍝ apl = Apl data
⍝ Get the name of the column colName←dt.Columns[colNumber-1].ColumnName
⍝ Create a .net string vector (string[]) with that name ⎕USING←'' 'System.Data,System.Data.dll' string←System.Array.CreateInstance(System.Type.GetType⊂'System.String')1 string.SetValue(colName 0)
⍝ Make a DataView and filter the method .ToTable dv←⎕NEW DataView dt apl←,2011⌶dv.ToTable(0 string)
Last edited by PGilbert on Thu Mar 19, 2015 12:38 pm, edited 1 time in total.
System.Int64 is not a type whose instances you can represent without loss of precision as native types in Dyalog APL. As long as the integer it wraps is less than 2*53 then you'll be fine. If it's larger then 2*53 (and with an Int64 you have another 11 bits to make your number much bigger) then you won't be fine... Because the trick of executing the formatted version is going to give you a truncated float.
Thanks Pierre for all the code on APLWiki. It is so useful to have samples available. Stefano the numbers are small (less than 100), it is the UID field in syslogins table but it comes back as Int64. I anticipate a lossless conversion.