SQL Server一般用bit类型即可,数据库中存储的是0(false)或1(true)。
Oralce没有表示是否的类型,但可用数字型number(1)或字符型代替char(1)。
///
/// Converter to use boolean data type with Oracle
///
/// Value to convert
///
public static string OraBit(bool value) {
if(value)
return "Y";
else
return "N";
}
/// /// Converter to use boolean data type with Oracle /// /// Value to convert /// public static bool OraBool(string value) { if(value.Equals("Y")) return true; else return false; }