Ramco Ramco

Ramco Ramco

  • 419
  • 3.4k
  • 547.8k

Cannot implicitly convert type string to Boolean

Jun 5 2021 7:40 AM
Hi
 
  In Sql i have Bit DataType.
 
In Class i have written like below :-
[Display(Name = "Active")]
public bool IsActive { get; set; }
 
 
while (rdr.Read())
{
objLocation.Add(new Location
{
Id = rdr["Id"].ToString(),
Description = rdr["Description"].ToString(),
IsActive = rdr["IsActive"].ToString(),
});
}
 
Thanks 

Answers (2)