K
Kurt
Hi,
I am having some trouble with a custom IDataReader and the DataTable.Load
method when dealing with NULL data, specifically, if a data value is changed
in a loaded DataTable from say a double value of 56.23 to a NULL value, the
source is updated and the DataTable load is called again using IDataReader,
the null value will not be loaded into the updated DataTable, the original
value of 56.23 stays. If I call DataTable.Rows.Clear() prior to doing the
load, the data is accurately reflected. I did this to verify the data was
passing through the IDataReader class successfully. Although we are using
this as a work around, it would be preferable to do the load without the
clear, as this prevents the UI grids from clearing and re-loading.
I verified that the IDataReader is returning a NULL value in the appropriate
column; however, when looking at the final loaded DataTable in the debugger,
that value change is not reflected. I have also tried all of the LoadOptions,
and this did not change the behavior. Finally, I checked the RecordsAffected
property of the IDataReader and this is returning a value > 0, I also tried
setting this to -1, but this also made no difference.
I am not sure what else to try, as something is happening in the DataTable
load process that I do not understand..?
I am having some trouble with a custom IDataReader and the DataTable.Load
method when dealing with NULL data, specifically, if a data value is changed
in a loaded DataTable from say a double value of 56.23 to a NULL value, the
source is updated and the DataTable load is called again using IDataReader,
the null value will not be loaded into the updated DataTable, the original
value of 56.23 stays. If I call DataTable.Rows.Clear() prior to doing the
load, the data is accurately reflected. I did this to verify the data was
passing through the IDataReader class successfully. Although we are using
this as a work around, it would be preferable to do the load without the
clear, as this prevents the UI grids from clearing and re-loading.
I verified that the IDataReader is returning a NULL value in the appropriate
column; however, when looking at the final loaded DataTable in the debugger,
that value change is not reflected. I have also tried all of the LoadOptions,
and this did not change the behavior. Finally, I checked the RecordsAffected
property of the IDataReader and this is returning a value > 0, I also tried
setting this to -1, but this also made no difference.
I am not sure what else to try, as something is happening in the DataTable
load process that I do not understand..?