MSTSE Developer [mailto:[EMAIL PROTECTED]] wrote:

> something like that it must be! but setting to missing or
> just to null does not work. when i set one value in the
> datarow to null or missing i get an exception which tells me
> that i have to use dbnull! but when i try to put null direct
> into the itemarray nothing happend! no exceptions! no changes!

DataRow? You didn't mention that before and I think I see what your problem
is now. A DataColumn only supports representing null using DbNull, as you've
discovered. The way you're changing the values in ItemArray doesn't work
because you're only modifying the value in your local array reference and
not resetting the property. Even then it would throw a ArgumentException(?)
because of the afforementioned null/DbNull issues.

What you need to do is stick with representing null in the DataColumn by
using DbNull. Then you need to do a little extra tweaking between marhsalled
calls. I assume you're taking the ItemArray and passing it's values to the
COM object? If so you'll need to translate DbNull to null in your local
array reference, make the COM call, translate null back to DbNull before
returning the values by setting ItemArray array properties.

HTH,
Drew
.NET MVP

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to