0
Reply

Visual CObol in Visual Studio- SQL Directives

John Mark Olesco

John Mark Olesco

Mar 5 2013 12:00 PM
1.3k
hello good day..
i am currently creating my project in cobol2 .. i am using a visual cobol of microfocus and was used a Ado.net for my database.. On the interface of openesql assistant i can insert values in my database table..
but on the form of my project on the button1 clicked i've got an error saying "NO SQL DIRECTIVES HAVE BEEN SET"

(here is my code 
method-id button1_Click final private.
       procedure division using by value sender as object e as type System.EventArgs.
       
       EXEC SQL
        INSERT INTO NayreInventory  
        (ItemCode
        ,ItemDescription
        ,Quantity
        ,Price
         ) VALUES (
         :NayreInventory-ItemCode:NayreInventory-ItemCode-0001
        ,:NayreInventory-ItemDescription:Col-2-MEDICOL
        ,:NayreInventory-Quantity:NayreInventory-Quantity-5
        ,:NayreInventory-Price:NayreInventory-Price-150
         )
       END-EXEC. 
       
       invoke type MessageBox::Show("1 RECORD HAS BEEN SUCCESSFULLY ADDED", "RESULT")
       end method.

)
how to get rid on the error..
please help me .. i really nid ur help..