0

How to create null byte?

This is what I do

byte? nb = null;

methodCall (rdr.IsDBNull(15) ? nb : rdr.GetByte(15));

This does not even complile.
What is the proper syntax?

methodCall (rdr.IsDBNull(15) ? (null)byte : rdr.GetByte(15));
4

1 回答 1

2

Try:

(byte?)null : rdr.GetByte(...)
于 2013-03-30T22:23:55.623 回答