Consultor Eletrônico



Kbase P114018: Input Temp-Table DateTime field is not correctly passed from a .NET client to the AppServer
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   06/04/2007
Status: Unverified

FACT(s) (Environment):

OpenEdge 10.x

SYMPTOM(s):

Temp-Table Datetime field is not correctly passed from a .NET client to the AppServer

The Datetime field becomes a Date field.

The Temp-Table is passed as INPUT TABLE-HANDLE

The problem does not occur when passing an OUTPUT TABLE-HANDLE

It works fine when calling the 4GL procedure from a 4GL client via the AppServer

CAUSE:

This is expected behavior.

When passing a dynamic dataset from a .NET client to the AppServer and the DataTables contain .NET System.DateTime fields, each fields needs to be mapped to the Progress DateTime data type. Otherwise, the AppServer receives the DateTime field as Date data type.

FIX:

To map the DateTime fields to the Progress DateTime data type, call the static SetColumnProType method against each DateTime field of the DataTable.

For example:

// Temp-Table definitions
System.Data.DataTable hTT= new System.Data.DataTable();
hTT.Columns.Add("ID",typeof(int));
hTT.Columns.Add("StartDaTe",typeof(DateTime));
hTT.Columns.Add("DueDaTe",typeof(DateTime));
hTT.Columns.Add("EndDaTe",typeof(DateTime));

// Map .NET DateTime to Progress DateTime
ProDataTable.SetColumnProType(hTT, "StartDaTe", Parameter.PRO_DATETIME);
ProDataTable.SetColumnProType(hTT, "DueDaTe", Parameter.PRO_DATETIME);
ProDataTable.SetColumnProType(hTT, "EndDaTe", Parameter.PRO_DATETIME);