Reference > DBUtil Class

DBUtil Class

This class provides a small set of static methods for extracting array data from database tables. See DbUtil Members for the full list of static methods, and the tutorial on aggregating data for some worked examples.

public class DbUtil

DbUtil Methods

GetDoublesGet one or more Double columns from a Selection, with optional missing value filler
GetIntegersGet one or more Integer columns from a Selection, with optional missing value filler
GetStringsGet one or more String columns from a Selection, with optional missing value filler

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("year>2006 AND symb='BP'");
 int[] BP = DbUtil.GetIntegers(myselection,filler,"SharePrice");
 
 sp.Heading = "BP";
 sp.HeadingStyle = HeadingStyles.Right;
 sp.DrawLineGraph(BP);

This example simply retrieves one complete column from the current selection, using SharpPlot’s missing value setting to replace any DBNull values in the data.

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)


Send comments on this topic
© Dyalog Ltd 2013