I have a transaction, there is a method calling in the tran. which makes insertion into a table, after that when i select the row that i have inserted, i find no result
how can i solve this problem without changing this structure or what else can i do?
Thanks in advance
using (TransactionScope scope01 = new TransactionScope(option01, span01)) {
InsertIntoTable(); // inserting a row into Foo table , insert into...executenonquery
string smcd = "select * from Foo Where XCol=@XParm";
ExecuteQuery(scmd); // This Returns no result
scope01.Complete(); }
Loading
Posted Sep 25, 2013, 1:16 PM
Posted Sep 26, 2013, 2:05 AM
bill brownPosted Sep 26, 2013, 2:03 AM
bill brownPosted Sep 25, 2013, 10:24 AM
bill brownPosted Sep 25, 2013, 8:16 AM
Muhammad younasPosted Sep 25, 2013, 8:11 AM
bill brownPosted Sep 25, 2013, 7:59 AM
Posted Sep 25, 2013, 7:05 AM
http://technet.microsoft.com/en-us/library/ms173763.aspx
Specifies that statements cannot read data that has been modified but not committed by other transactions. This prevents dirty reads. Data can be changed by other transactions between individual statements within the current transaction, resulting in nonrepeatable reads or phantom data. This option is the SQL Server default.
You can't read the inserted values until the tractions is completed. So make sure, ExecuteQuerey() method is not creating a new tractions.
Please let me know, if you want to discuss it more.
bill brownPosted Sep 25, 2013, 6:59 AM
Posted Sep 25, 2013, 5:27 AM
bill brownPosted Sep 25, 2013, 5:24 AM
Posted Sep 25, 2013, 4:46 AM