Adapter .NET DataTable
Warning : The DataTable Adapter is outdated and no longer being developed. All the transformations described here can now be carried out better and more easily by using integrated data Adapters.
The .NET DataTable Adapter was designed for .NET developers to enable them to integrate any data source and/or any data target into FlowHeater. When we were developing the DataTable Adapter we took care to make it uncomplicated and achievable with just a few clicks and a short piece of code.
General tab
Here you specify the .NET DLL (Assembly) that contains your own written .NET classes. After you have selected a .NET DLL you can choose from your own classes in a select box. By using the Check button you have a further possibility to run a short test of your entries.
The only prerequisite is your .NET class must define one or two predefined functions (take care to observe upper and lower case). According to whether you want to pass your function parameters, one of the functions specified here will be called.
the READ side:
// This function is called when no parameters are definedpublic DataTable FlowHeater_GetDataTable( int rows )
{
// Your own code incl. creation of the DataTable columns
}
or
// This function is called when there are parameters defined
public DataTable FlowHeater_GetDataTable( int rows, StringDictionary parameter)
{
// Your own code incl. creation of the DataTable columns
}
If your function is given as parameter -1, the function should deliver all a vailable data in the DataTable, otherwise the number of rows of data.
the WRITE side:
// This function is called when no parameters are defined
public void FlowHeater_SetDataTable( DataTable dt)
{
// Your own code incl. creation of the DataTable columns
}
or
// This function is called when there are parameters defined
public void FlowHeater_SetDataTable(DataTable dt, StringDictionary parameter)
{
// Your own code incl. creation of the DataTable columns
}
This function is only passed the DataTable filled out by FlowHeater.
Note: The "FlowHeater_SetDataTable" function will not be called when you run the Definition in test mode. For this reason you can rest assured that test data or incorrect data during development will not be passed to your class or function.
Parameter tab
Using this tab you can pass any parameters you wish to your own .NET DLL function. The parameters are passed as a .NET StringDictionary object. The individual parameter values can be retrieved as demonstrated in the following function.
public void FlowHeater_SetDataTable(DataTable dt, StringDictionary parameter)
{
string server = parameter["Server"];
}
in this example (illustrated) the variable Server will be assigned "obelix".
Fields / Data types tab
Here you specify the fields and data types that the DataTable Adapter shall deal with from your .NET DataTable.
Note:
- Only the data types listed in the Data Type dropdown are possible.
- The FlowHeater data types of Date and Time are converted to the .NET data type DateTime.
Using the button "Load fields from the Data Table of the DLL" the DataTable definitions are loaded that are returned by the function FlowHeater_GetDataTable(0).
Adapter settings in the Format tab
Examples
-
The general handling of the DataTable Adapter are introduced here by way of several short examples.
-
A simple example of how the data from any data source (READ) can be exported as XML