1
if(oDataTable.Rows[0]["File"] != null) //byte array
{

}

File column in my table seems null. However when I try to check if it is null or not in the code part, it doesn't go to else part. Can someone tell me how to fix this?

1
  • 1
    Could it possibly be DBNull instead of null? I would need to see more of your code to know for certain. Commented Apr 11, 2012 at 14:47

1 Answer 1

2

I think you should check for DBNull with Convert.IsDBNull:

if(!Convert.IsDBNull(oDataTable.Rows[0]["File"]))
{
}
Sign up to request clarification or add additional context in comments.

1 Comment

You can accept an answer in 6 minutes, it says ;) After that I'll.

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.