Using ADO DataSet

If you want to use a DataTable in an ADO.NET DataSet to build the DataWindow, specify ADO DataSet as the data source. A File Open dialog box displays so that you can select a typed DataSet in an XML schema definition (XSD) file. You can then select one (and only one) of the DataTables in the DataSet.

All the columns in the selected DataTable are included in the DataWindow. If the DataTable is a result set from a join of multiple tables, the DataWindow will include columns from multiple tables.

NoteCrosstab not supported You cannot use the Crosstab presentation style with the ADO DataSet data source.

StepsTo define the data using ADO DataSet:

  1. Click ADO DataSet in the Choose Data Source dialog box in the wizard and click Next.

    A file selection dialog box displays.

  2. Select the XSD file you want to use to access the data.

  3. Select one DataTable that you will use as the data source for the DataWindow object.

  4. Complete the DataWindow wizard as needed for the presentation style you are using.

    When you have finished interacting with the wizard, you go to the DataWindow painter. All the columns in the DataTable display in the DataWindow object. You can manipulate the presentation characteristics in the Design view.

Previewing the DataWindow

You cannot retrieve rows into the DataWindow object in DataWindow Designer, but you can import rows from an external file as described in “Using External”.

Datatype mappings

Table 4-5 lists .NET datatypes and the DataWindow datatypes to which they map when you use a DataTable as a data source.

Table 4-5: Datatype mappings from .NET to the DataWindow

.NET datatype

DataWindow datatype

System.Boolean

long (handled as a boolean at runtime)

System.Byte

long

System.Char

string(1)

System.DateTime

datetime

System.Decimal

decimal(0,0)

System.Double

number

System.Guid

not supported

System.Int16

long

System.Int32

long

System.Int64

decimal

System.SByte

ulong

System.Single

real

System.String

string(40)

System.Timespan

real

System.UInt16

ulong

System.UInt32

ulong

System.UInt64

decimal

System.Byte[ ]

not supported

Defaults for string and decimal datatypes

The System.String type does not always specify a maximum length. The length of string columns defaults to 40 characters in the DataWindows. The System.Decimal types do not specify a precision, and the precision defaults to 0 in the DataWindow. You can change these defaults in the Column Specifications view in the DataWindow painter.

For more information about using DataSets with DataWindows, see the DataWindow .NET Programmer’s Guide.