Hello all,
I need help...
I have c# code in which i have transaction I am adding row to table in transaction and updating same table's column using procedure in same transaction. But i am not getting updated rows when I am retriving from store procedure .
Example:
db.Connection.Open();
using (var dbcxtransaction = db.Connection.BeginTransaction())
{
while (odr.Read())
{
var model = new TEMP_EXCEL();
model.EXID = Convert.ToInt32(odr[0]);
model.EXCOL1 = odr[1].ToString().Trim();
model.EXCOL2 = odr[2].ToString().Trim();
db.TEMP_EXCEL.AddObject(model);
db.SaveChanges();
}
/// comment transaction.commit() I dont want to insert any data permanently in TEMP_EXCEL
IList<TEMP_EXCEL> EXCEL = db.PROC_UPLOADMACHINES("Y").ToList();
db.SaveChanges();
}
In above example m adding rows in TEMP_EXCEL which is in transaction but I don't want to commit any data in TEMP_EXCEL
alter PROCEDURE PROC_UPLOADMACHINES
@saveFlag varchar(1)
AS
BEGIN
declare @hasError bit
update TEMP_EXCEL set EXCOL3 ='test'
select * from TEMP_EXCEL
END
GO
I am not getting updated record in
IList<TEMP_EXCEL> EXCEL = db.PROC_UPLOADMACHINES("Y").ToList();
Plz help