更新时间:2023-01-07 23:12:44
check Boolean.TryParse Method(String,Boolean)(System) [ ^ ]
check Boolean.TryParse Method (String, Boolean) (System)[^]
bool isActive = false;
if (bool.TryParse(rdr["Is_Active"] + "", out isActive)) {
emp.IsActive = isActive
}
else
{
// show the error message to the user
}