Since this is Visual Basic you have 2 division operators/ which is for Standard division and \ which is used for integer division, which returns the "integer quotient of the two operands, with the remainder discarded" which sounds like what you want.
In VB.NET even if both the operands are integer, the / operator will cause the value to be floating point (if the result is non integer).
So I tried with the \ operator which yields integer value irrespective of the operands.
…
I have some code and when it executes, it throws a NullReferenceException, saying:
Object reference not set to an instance of an object.
What does this mean, and what can I do to fix this error?
I'm converting something from VB into C#. Having a problem with the syntax of this statement:
if ((searchResult.Properties["user"].Count > 0))
{
profile.User = System.Text.Encoding.UTF8.GetString(searchResult.Properties["user"][0]);
}
I then see the following errors:
Argument 1: cannot …