I'm trying to run the below query using Linq:
var ResultRows = from MyRow in MyDataTable.AsEnumerable()
where Convert.ToBoolean(MyRow.Field<byte>("IsTrue")) == true
select MyRow;
where one of the column is a boolean (not null). I know that boolean in MySql is recorded as tinyint and is recognized as a byte in C#. I've tried converting to int but I keep getting the "specific cast is not valid" error. The only time it worked was when I changed the MySql's column datatype to int and compare against that. How can I get this to work without changing the Mysql's column datatype?