[Quantproject-developers] QuantProject/b1_ADT ExtendedDataTable.cs, 1.10, 1.11
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2008-01-14 23:10:05
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv8107/b1_ADT Modified Files: ExtendedDataTable.cs Log Message: Added static method GetArrayOfStringFromColumn Index: ExtendedDataTable.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b1_ADT/ExtendedDataTable.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ExtendedDataTable.cs 25 Jun 2005 10:01:54 -0000 1.10 --- ExtendedDataTable.cs 14 Jan 2008 23:10:00 -0000 1.11 *************** *** 109,112 **** --- 109,136 ---- } /// <summary> + /// Get an array of string corresponding to a column compatible with the string type in a given data table + /// </summary> + public static string[] GetArrayOfStringFromColumn(DataTable table, + int columnIndex) + { + int numRows = table.Rows.Count; + string[] arrayOfString = new string[numRows]; + int index = 0; + try + { + for(; index!= numRows; index++) + { + arrayOfString[index] = (string) table.Rows[index][columnIndex]; + } + } + catch(Exception ex) + { + MessageBox.Show(ex.ToString()); + index = numRows; + } + return arrayOfString; + } + + /// <summary> /// Get an array of float corresponding to a column compatible with the float type in a given data table, /// filtered by the given filterExpression |