如何检查所有插入查询是否正确? [英] How to check all insert queries if its correct?
本文介绍了如何检查所有插入查询是否正确?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
在我的程序中,我有更多这样的插入命令
in my program I have more insert commands, like this
using (S.SQLiteCommand cmd = new S.SQLiteCommand(query1, con))
{
}
using (S.SQLiteCommand cmd = new S.SQLiteCommand(query2, con))
{
}
using (S.SQLiteCommand cmd = new S.SQLiteCommand(query3, con))
{
}
...带有参数....
... with Parameters ....
但是,如果第三个错误是一个错误,则在try-catch中显示一个错误...但是前两个已经插入了数据.
But if in the third one is a mistake it shows me in try-catch an error ... but first two has already inserted data.
因此,如何首先使用/insert-command检查所有三个/或更多命令,如果三个都正确,则允许将其插入数据库.
So how to check first all three/or more using/insert-commands and if all three are correct then allow to insert it to database.
希望你能理解我.感谢您的回答.
Hope u understand me. Thanks for answers.
推荐答案
Takesh,
Hi Takesh,
您没有提供正在使用的INSERT查询.
You didn't provide the INSERT query that you are using.
这篇关于如何检查所有插入查询是否正确?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文