DataGridView and TempTables

Posted by Admin on 05-Nov-2010 10:17

Hy everyone,

I've got 2 tables : Customer and Order and I'm trying to populate a DatagridView with 2 columns which match Customer.maj_user and Order.maj_user.

Here is the code :

DEF TEMP-TABLE ttCust

   FIELD CustomerID LIKE Customer.CustomerID

   FIELD maj_user_customer LIKE Customer.maj_user

   FIELD OrderID LIKE Order.OrderID

   FIELD maj_user_order LIKE Order.maj_user.

DEFINE QUERY qCust FOR CUSTOMER, ORDER.

DEFINE DATA-SOURCE srcCustomer FOR QUERY qCust.

DEFINE DATASET dsCust FOR ttCust.

DEF VAR hqCust as handle.
hqCust = QUERY qCust:HANDLE.

hqCust:QUERY-PREPARE("FOR EACH customer NO-LOCK, FIRST order OF customer NO-LOCK).

BUFFER ttCust:ATTACH-DATA-SOURCE(DATA-SOURCE srcCustomer:HANDLE).

DATASET dsCust:FILL().

bindingSourceCustomer:Handle = DATASET dsCust:HANDLE.

My problem is that column "maj_user_order" and "maj_user_customer" are empty

I'm a beginner with Progress GUI .NET.

I'm looking for a solution everywhere but no results

Somebody can help me?

Thank you.

All Replies

Posted by Håvard Danielsen on 09-Nov-2010 08:15

The fields maj_user_customer and maj_user_order will not be filled because there are no fields with the same names in the attached data source. The ATTACH-DATA-SOURCE method has optional parameters for this. Your data source apparently has two maj_user fields, so you will need to qualify the reference for each mapping.

buffer ttCust:attach-data-source(data-source srcCustomer:handle,"maj_user_customer,Customer.maj_user,maj_user_order,Order.maj_user").

This thread is closed