I have many new wizard-created DataTables in my project, which I need to extract data from. There are many string columns with dbnull values in these tables, which I want to extract as empty strings.
So I went ahead and changed the NullValue
property of each DataColumn
with DataType
of System.String
from (Throw exception)
to (Empty)
like this:
I soon got tired of all the repetitive work, so I tried to set NullValue
programmatically in the data layer of my application.
I was, however, unable to even find this property. I even decompiled the code of System.Data.DataColumn
and the property NullValue
did not seem to exist there. NullValue
may be some magic feature of Microsoft.VSDesigner.Data.Design.DataColumnEditor
, but that's nothing more than a mere suspicion at the moment.
How can I programmatically achieve the same effect as if I did set NullValue
to (Empty)
in the property editor)?