Thursday, June 2, 2011

String was not recognized as a valid Boolean In C#

String was not recognized as a valid Boolean In C# .

Introduction : In this article i will show how to resolve the error string was not recognized as a valid Boolean in . Its very easy to resolve .just you need to create one method .Pass the string to method then it will return Boolean .

Method for valid Boolean :
    private static bool GetBoolean(string strValue)
    {
        if (strValue=="1")
            return true;
        else
            return false;
    }

Call the function :
 GetBoolean(stringValue) ;

Related Other posts

0 comments:

Post a Comment