如何在winform应用中使用Sql事务 [英] how To Use Sql Transactions in winform aaplication
问题描述
我在数据库中有Master Details表,因为我一次要插入所有输入.首先我要将数据插入到master表中,然后再将它插入到details表中.
我遇到一个问题,例如主表中的数据被正确填充,并且尝试将数据插入到明细表中时会引发错误并且数据没有存储在明细表中...因为我现在没有使用sql事务,所以我的主表包含在详细信息表中没有详细信息的行,因此这将在尝试获取数据时引发错误...如何解决...请帮助
i have Master Details table in database.on from i am inserting all input at a time.firstly i am inserting data in to master table and after that in details table.
I got a problem like data in master table is filled accurately and while trying to insert data into details table it will raised error and data is not get stored in the details table...as i have not used sql transaction now my Master table contains a row which don''t have details information in details table,so this will raise errors while trying to fetch data...How To Solve this ...Please Help
推荐答案
在ADO.NET中使用事务 [
^ ]
代码属于asp.net,但您可以在C#中使用代码隐藏代码SQL transactions in .NET[^]
code is of asp.net but you can use codebehind code in C#
这篇关于如何在winform应用中使用Sql事务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!