G
Gary Shell
Still fighting with why the EndCurrentEdit seems to clear the underlying
Datasets.Item collection when a exception is thrown, I thought of a
workaround.
I thought I'd declare dsclone as Dataset, copy my actual dataset (which
should clone the structure and copy the data) and then after the exception
is thrown, restore the actual dataset from the clone. I used the following
to clone the dataset:
dsclone = Me.dsMetric.Copy
But what I got was NOT an exact copy. Here is the proof from the immediates
window immediately after executing the COPY method:
?dsmetric.Tables(0).Rows (0).ItemArray
{Length=9}
(0): 0 {Integer}
(1): "2451254"
(2): ""
(3): {System.DBNull}
(4): {System.DBNull}
(5): {System.DBNull}
(6): {System.DBNull}
(7): True {Boolean}
(8): False {Boolean}
?dsclone.Tables(0).Rows (0).ItemArray
{Length=9}
(0): 0 {Integer}
(1): ""
(2): ""
(3): ""
(4): {System.DBNull}
(5): ""
(6): {System.DBNull}
(7): True {Boolean}
(8): False {Boolean}
What is very odd, is after the EndCurrentEdit and the exception is thrown,
look at what happens to the actual dataset.
?dsmetric.Tables(0).Rows (0).ItemArray
{Length=9}
(0): 0 {Integer}
(1): ""
(2): ""
(3): ""
(4): {System.DBNull}
(5): ""
(6): {System.DBNull}
(7): True {Boolean}
(8): False {Boolean}
It's as if there are two instances of dsmetric, one that the immediate
window can see and one that the copy method and then latter the
EndCurrentEdit can see.
Can anybody shed ANY light on this. Browsing through the BindingContext
object it does look like MAYBE it might actually house an instance of the
dataset but I don't understand tat object well enough to understand if it
has any bearing on what I am seeing.
Thanks,
Gary
Datasets.Item collection when a exception is thrown, I thought of a
workaround.
I thought I'd declare dsclone as Dataset, copy my actual dataset (which
should clone the structure and copy the data) and then after the exception
is thrown, restore the actual dataset from the clone. I used the following
to clone the dataset:
dsclone = Me.dsMetric.Copy
But what I got was NOT an exact copy. Here is the proof from the immediates
window immediately after executing the COPY method:
?dsmetric.Tables(0).Rows (0).ItemArray
{Length=9}
(0): 0 {Integer}
(1): "2451254"
(2): ""
(3): {System.DBNull}
(4): {System.DBNull}
(5): {System.DBNull}
(6): {System.DBNull}
(7): True {Boolean}
(8): False {Boolean}
?dsclone.Tables(0).Rows (0).ItemArray
{Length=9}
(0): 0 {Integer}
(1): ""
(2): ""
(3): ""
(4): {System.DBNull}
(5): ""
(6): {System.DBNull}
(7): True {Boolean}
(8): False {Boolean}
What is very odd, is after the EndCurrentEdit and the exception is thrown,
look at what happens to the actual dataset.
?dsmetric.Tables(0).Rows (0).ItemArray
{Length=9}
(0): 0 {Integer}
(1): ""
(2): ""
(3): ""
(4): {System.DBNull}
(5): ""
(6): {System.DBNull}
(7): True {Boolean}
(8): False {Boolean}
It's as if there are two instances of dsmetric, one that the immediate
window can see and one that the copy method and then latter the
EndCurrentEdit can see.
Can anybody shed ANY light on this. Browsing through the BindingContext
object it does look like MAYBE it might actually house an instance of the
dataset but I don't understand tat object well enough to understand if it
has any bearing on what I am seeing.
Thanks,
Gary