Hi all,
I have a problem using Proxy Generator base .Net 2.0 SDK with .Net Framework v2.0.50727 to generate the DLL file. Is there anyone facing the same problem like me?
It prompt me the error as below:
Spec:
OpenEdge10.0B03
Error as below:
StrongTypesNS\custordlin.cs(1,1): error CS0116: A namespace does not directly contain members such as fields or methods
According to MSDN, The error is due to the:
/*====================================================*/
// CS0116.cs
namespace x
{
using System;
// method must be in class/struct
void Method(string str) // CS0116
{
Console.WriteLine(str);
}
// To fix the error, you must
// enclose a method in a class:
class Program
{
void Method2(string str)
{
Console.WriteLine(str);
}
}
}
/*====================================================*/
My 4GL Procedure Example:
/*====================================================*/
DEFINE TEMP-TABLE ttcust
FIELD custnum AS INTEGER
FIELD bfname AS CHARACTER.
DEFINE TEMP-TABLE ttorder
FIELD ordernum AS CHARACTER
FIELD custnum AS INTEGER.
DEFINE TEMP-TABLE ttordlin
FIELD ordernum AS CHARACTER
FIELD bforderline AS INTEGER
FIELD bforderitem AS CHARACTER.
DEFINE DATASET custordlin FOR ttcust, ttorder, ttordlin
DATA-RELATION custord FOR ttcust, ttorder RELATION-FIELDS (custnum,custnum)
DATA-RELATION OrdOrdLine FOR ttorder, ttordlin RELATION-FIELDS(ordernum,ordernum).
DEFINE INPUT PARAMETER NumCusts AS INTEGER.
DEFINE OUTPUT PARAMETER DATASET FOR custordlin.
DEFINE OUTPUT PARAMETER sError AS CHAR FORMAT "x(30)".
/* */
DEFINE VARIABLE i AS INTEGER NO-UNDO.
DEFINE VARIABLE i1 AS INTEGER NO-UNDO.
DEFINE VARIABLE i2 AS INTEGER NO-UNDO.
DO i = 1 TO 100:
CREATE ttcust.
ttcust.custnum = i.
ttcust.bfname = "customer " + STRING(i).
DO i1 = 1 TO 30:
CREATE ttorder.
ttorder.ordernum = STRING(i,"9999") + STRING(i1,"999").
ttorder.custnum = i.
DO i2 = 1 TO 50:
CREATE ttordlin.
ttordlin.ordernum = ttorder.ordernum.
ttordlin.bforderline = i2.
ttordlin.bforderitem = "item " + STRING(i2).
END.
END.
END.
/*====================================================*/
I have a problem using Proxy Generator base .Net 2.0 SDK with .Net Framework v2.0.50727 to generate the DLL file. Is there anyone facing the same problem like me?
It prompt me the error as below:
Spec:
OpenEdge10.0B03
Error as below:
StrongTypesNS\custordlin.cs(1,1): error CS0116: A namespace does not directly contain members such as fields or methods
According to MSDN, The error is due to the:
/*====================================================*/
// CS0116.cs
namespace x
{
using System;
// method must be in class/struct
void Method(string str) // CS0116
{
Console.WriteLine(str);
}
// To fix the error, you must
// enclose a method in a class:
class Program
{
void Method2(string str)
{
Console.WriteLine(str);
}
}
}
/*====================================================*/
My 4GL Procedure Example:
/*====================================================*/
DEFINE TEMP-TABLE ttcust
FIELD custnum AS INTEGER
FIELD bfname AS CHARACTER.
DEFINE TEMP-TABLE ttorder
FIELD ordernum AS CHARACTER
FIELD custnum AS INTEGER.
DEFINE TEMP-TABLE ttordlin
FIELD ordernum AS CHARACTER
FIELD bforderline AS INTEGER
FIELD bforderitem AS CHARACTER.
DEFINE DATASET custordlin FOR ttcust, ttorder, ttordlin
DATA-RELATION custord FOR ttcust, ttorder RELATION-FIELDS (custnum,custnum)
DATA-RELATION OrdOrdLine FOR ttorder, ttordlin RELATION-FIELDS(ordernum,ordernum).
DEFINE INPUT PARAMETER NumCusts AS INTEGER.
DEFINE OUTPUT PARAMETER DATASET FOR custordlin.
DEFINE OUTPUT PARAMETER sError AS CHAR FORMAT "x(30)".
/* */
DEFINE VARIABLE i AS INTEGER NO-UNDO.
DEFINE VARIABLE i1 AS INTEGER NO-UNDO.
DEFINE VARIABLE i2 AS INTEGER NO-UNDO.
DO i = 1 TO 100:
CREATE ttcust.
ttcust.custnum = i.
ttcust.bfname = "customer " + STRING(i).
DO i1 = 1 TO 30:
CREATE ttorder.
ttorder.ordernum = STRING(i,"9999") + STRING(i1,"999").
ttorder.custnum = i.
DO i2 = 1 TO 50:
CREATE ttordlin.
ttordlin.ordernum = ttorder.ordernum.
ttordlin.bforderline = i2.
ttordlin.bforderitem = "item " + STRING(i2).
END.
END.
END.
/*====================================================*/