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));

1 Answer 1

2

Try:

(byte?)null : rdr.GetByte(...)
Sign up to request clarification or add additional context in comments.

1 Comment

Cannot accept for 7 minutes. Now that I see the answer it makes sense.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.