Convert To Bool - CSharp System

CSharp examples for System:Converter

Description

Convert To Bool

Demo Code


using System.Data.SqlClient;
using System.Data;
using System.Collections.Generic;
using System;/*from  w w  w  .  jav  a 2  s .c o m*/

public class Main{
        internal static bool ConvertToBool(object value)
        {
            bool boolValue = false;
            if (!Convert.IsDBNull(value))
            {
                boolValue = Convert.ToBoolean(value);
            }
            return boolValue;
        }
}

Related Tutorials