如何放置msgbox来检查数据是否已插入? [英] How to put a msgbox to check whether the data has been inserted or not?

查看:100
本文介绍了如何放置msgbox来检查数据是否已插入?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的编码员,

在以表格形式输入数据后,单击绑定导航器上的保存按钮后,我想检查一下是否将数据插入到数据库中.但是该保存按钮中没有事件.因此,请为我提出实现该问题的解决方案.

Dear Coders,

I would like to check once I click on the save button on the Binding Navigator after entering the data in the form whether the data is Inserted into the Database or not. But there is no event in that save button. So Suggest me a solution for achieving it.

推荐答案

请看下面的链接,当您完成查询时,它将重新调整受查询影响的行数.之后,您可以进行if测试,以检查返回的行数是否大于0,并执行所需的任何操作.

http://msdn.microsoft.com /en-us/library/system.data.sqlclient.sqlcommand.executenonquery(v=VS.71).aspx [
Look at the link below, when you complete your query it will retun the number of rows affected by the query. You can do an if test after that to check to see if the number of rows returned is greater than 0 and perform whatever action you need.

http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.executenonquery(v=VS.71).aspx[^]


这篇关于如何放置msgbox来检查数据是否已插入?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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