I am stumped with this code. Having just discovered the nul coalescing operator i am trying to convert all my code to use the operator
I converted this
if (dRow["bookid"] != DBNull.Value)
{ BookID = (int?)dRow["bookid"]; }
else
{ BookID = null; }
to this
BookID = (int?)dRow["bookid"] ?? null;
and now it gives a "Specified cast is not valid" error
How can i correctly convert the first code segment to use the null coalescing operator
www.xhydra.com