Skip to main content

This is the link to the MSDN using Statement documentation: http://msdn.microsoft.com/en-us/library/yh598w02.aspx

This is how it's coded in DevExpress:

using(UnitOfWork uow = new UnitOfWork()) {
    // Create, update or delete objects
    uow.CommitChanges();
}
 CommitChanges is used to update the database.

If Visual COBOL doesn't support the using statement, maybe I could call the Dispose method, which I'll need to work out.  Something like:

invoke uow::Dispose as type IDisposable (please correct me if this is wrong)


#VisualCOBOL

This is the link to the MSDN using Statement documentation: http://msdn.microsoft.com/en-us/library/yh598w02.aspx

This is how it's coded in DevExpress:

using(UnitOfWork uow = new UnitOfWork()) {
    // Create, update or delete objects
    uow.CommitChanges();
}
 CommitChanges is used to update the database.

If Visual COBOL doesn't support the using statement, maybe I could call the Dispose method, which I'll need to work out.  Something like:

invoke uow::Dispose as type IDisposable (please correct me if this is wrong)


#VisualCOBOL

Hi Phil, COBOL has the PERFORM USING statement, the equivalent is something like:

          perform using uow as type UnitOfWork = new UnitOfWork

             *> Create, update or delete objects

             invoke uow::CommitChanges()

          end-perform


This is the link to the MSDN using Statement documentation: http://msdn.microsoft.com/en-us/library/yh598w02.aspx

This is how it's coded in DevExpress:

using(UnitOfWork uow = new UnitOfWork()) {
    // Create, update or delete objects
    uow.CommitChanges();
}
 CommitChanges is used to update the database.

If Visual COBOL doesn't support the using statement, maybe I could call the Dispose method, which I'll need to work out.  Something like:

invoke uow::Dispose as type IDisposable (please correct me if this is wrong)


#VisualCOBOL

When I compile the above code, I get error "COBCH0854 Evaluation stack negative".


This is the link to the MSDN using Statement documentation: http://msdn.microsoft.com/en-us/library/yh598w02.aspx

This is how it's coded in DevExpress:

using(UnitOfWork uow = new UnitOfWork()) {
    // Create, update or delete objects
    uow.CommitChanges();
}
 CommitChanges is used to update the database.

If Visual COBOL doesn't support the using statement, maybe I could call the Dispose method, which I'll need to work out.  Something like:

invoke uow::Dispose as type IDisposable (please correct me if this is wrong)


#VisualCOBOL

That doesn't sound good.  Would it be possible to paste the example as you now have it, so that I can try to reproduce?  With the examples I tried, there didn't seem to be a problem, but I don't have access to UnitOfWork - is it a Microsoft class?


This is the link to the MSDN using Statement documentation: http://msdn.microsoft.com/en-us/library/yh598w02.aspx

This is how it's coded in DevExpress:

using(UnitOfWork uow = new UnitOfWork()) {
    // Create, update or delete objects
    uow.CommitChanges();
}
 CommitChanges is used to update the database.

If Visual COBOL doesn't support the using statement, maybe I could call the Dispose method, which I'll need to work out.  Something like:

invoke uow::Dispose as type IDisposable (please correct me if this is wrong)


#VisualCOBOL

We are using DevExpress for our user interface.  I tried creating the error in a demo but it always works.  It's only showing up in the application program which is much more complex than the demo.  I've found another way to update the database so I can get by without using the DevExpress UnitOfWork class for

now, but it could be a problem for us down the road.