W
W.G. Ryan eMVP
I've found something that's really befuddled me. I'm storing a DataView in
Session state and when I call Delete on it (and I'm NOT calling
AcceptChanges on the underlying Datatable) - it's reducing the rows count:
Debug.WriteLine("COUNT Before: " +
((DataView)Session["WorkingData"]).Count.ToString()); //2
((DataView)Session["WorkingData"]).Table.Rows.Delete();
Debug.WriteLine("COUNT After: " +
((DataView)Session["WorkingData"]).Count.ToString()); //1
I've used the exact same code referencing the Table property of the DataView
and I get the same behavior.
Now, when I call Reject changes immediately afterward - I get 2 and 0
instead of 2 and 2 which is what I'd expect.
This is totally opposite to everythign I would expect. Same code in a
Winforms scenario works exactly as I'd expect however - so I'm guessing it's
related to Session state - but why? DataTables are serializable so WTF?
Session state and when I call Delete on it (and I'm NOT calling
AcceptChanges on the underlying Datatable) - it's reducing the rows count:
Debug.WriteLine("COUNT Before: " +
((DataView)Session["WorkingData"]).Count.ToString()); //2
((DataView)Session["WorkingData"]).Table.Rows.Delete();
Debug.WriteLine("COUNT After: " +
((DataView)Session["WorkingData"]).Count.ToString()); //1
I've used the exact same code referencing the Table property of the DataView
and I get the same behavior.
Now, when I call Reject changes immediately afterward - I get 2 and 0
instead of 2 and 2 which is what I'd expect.
This is totally opposite to everythign I would expect. Same code in a
Winforms scenario works exactly as I'd expect however - so I'm guessing it's
related to Session state - but why? DataTables are serializable so WTF?