poogie22
asked on
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.Va lue.ToStri ng())
{
}
i am getting the above error in the following lines
if (objectID=System.DBNull.Va
{
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
how to use isdbnull
in C# u should use
if (objectid != Convert.DBNull)
{
}
if (objectid != Convert.DBNull)
{
}
objectID==System.DBNull.Va
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?