Visual Studio 2010数据库中的Visual Cobol [英] Visual Cobol in Visual Studio 2010 Database

查看:93
本文介绍了Visual Studio 2010数据库中的Visual Cobol的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好美好的一天..

i我目前在cobol2中创建我的项目..我正在使用微焦点的视觉cobol并且我的数据库使用了Ado.net ..在openesql的界面上助理我可以在我的数据库表中插入值..

但是在我点击按钮1的项目表单上我有一个错误说没有SQL指令已经设置



(这是我的代码

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.





如何摆脱错误..

请帮帮我..我真的需要你的帮助..



代码块和短信拼写[/ edit]

推荐答案

使用



use

try{

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

MessageBox.Show(ee.Message);

}



这样可以工作





[edit]代码块[/ edit]


这篇关于Visual Studio 2010数据库中的Visual Cobol的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆