I have the following declarations:
class DBDataContext : DataContext
{
public Table<ActivityActivity;
public DBDataContext(string connectionString) :
base(connectionString) { }
}
Entity class for Table Activity with the following column definition:
[Column(DbType = "Char(1) NOT NULL", CanBeNull=false)]
public char Activity_Type { get; set; }
In Main()
{
DBDataContext db = new DBDataContext(cnStr);
......
GetTypeActivity(db);
}
static void GetTypeActivity(DBDataContext db)
{
Console.WriteLine("Enter type to view (T, R, M, G) :");
char typ = (char)Console.Read();
var acttype = from t in db.Activity
where t.Activity_Type = typ
---------------------
select t;
Console.WriteLine(acttype.ToString()); // overloaded ToString()
}
The underlined expression in GetTypeActivity is giving an error: "Cannot
implicitly
convert type 'char' to 'bool'".
Appreciate an explanation and a solution!
Thanks