Cannot implicitly convert type 'int' to 'bool'

Cannot implicitly convert type 'int' to 'bool'

i am getting the above error in the following lines

if (objectID=System.DBNull.Value.ToString())
{
}


poogie22Asked:
Who is Participating?
 
razoConnect With a Mentor Commented:
if not isdbnull(objectid) then
dim b as boolean=ctype(objectid,boolean)
endif
0
 
ethothsCommented:
try
    objectID==System.DBNull.Value.ToString()

Note the double =.

In c# = is an assignment, == is a check for equality

I'm not too sure how this would work anyway. You probably should be using the IsDBNull function. It looks a little weird getting the value of a null and converting it to a string?



0
 
poogie22Author Commented:
how to use isdbnull
0
 
razoCommented:
in C# u should use
  if (objectid != Convert.DBNull)
            {
}
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.