Reference > DBUtil Class > GetStrings Method

GetStrings Method

Get one or more String columns from a Selection, with optional missing value filler. By default, the empty string is used to replace any DBNull values in the chosen column.

Example

 sp.Reset(240,160);
 sp.SetMargins(24,18,24,4);
 filler = (int)sp.MissingValue;
 
 mytable = new DataTable(); // Get some real data here!;
 myselection = mytable.Select("symb='BP'");
 
 string[] xlabs = DbUtil.GetStrings(myselection,"Year");
 
 sp.SetXLabels(xlabs);
 sp.DrawBarChart(BPAnnualEarnings);

Overloads

Description

Retrieves data from a data table selection in a form suitable for creating axis labels (single or multiple lines). The array of arrays of strings is ideal for use with spanned X-labels, for example:

string[][] labs = DbUtil.GetStrings(myselection,"Months","Quarters","Years");

If only one column is requested, the data is returned as a simple array of labels. It a numeric column is requested, it is returned as strings by running its default ToString method.

See also ...

Spanned labels in tables headers and X-labels | Working with Databases


Send comments on this topic
© Dyalog Ltd 2013