Click here to Skip to main content
15,887,453 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
SQL
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 need your help..

[edit]code block and sms-spelling[/edit]
Posted
Updated 5-Mar-13 6:42am
v2

1 solution

use

C#
try{

// your sql command and connection of database in c#
}catch(Exception ee){

MessageBox.Show(ee.Message);

}

this will work


[edit]code block[/edit]
 
Share this answer
 
v2
Comments
John Mark Olesco 5-Mar-13 22:13pm    
it seems that the solution is not right..

my problem is how to solve the error of visual cobol named
"NO SQL DIRECTIVES HAVE BEEN SET"

how to get rid on that error?
and please tell me how to configure the connection string of database(ADO.NET) in visual cobol

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900