This code works for me. Got this solution from one of the websites. Posting this as answer so it can help some body else. The below code is for querying data from joined tables on some condition and loading a Datatable (with known columns) from the resultant object array.
DataTable dttable = new DataTable();
dttable.Columns.Add("billno", typeof(String));
dttable.Columns.Add("date", typeof(DateTime));
dttable.Columns.Add("time", typeof(String));
dttable.Columns.Add("covers", typeof(Decimal));
dttable.Columns.Add("trcode", typeof(String));
dttable.Columns.Add("scode", typeof(String));
dttable.Columns.Add("gname", typeof(String));
dttable.Columns.Add("total", typeof(Decimal));
dttable.Columns.Add("login", typeof(String));
dttable.Columns.Add("resno", typeof(String));
dttable.Columns.Add("custcode", typeof(String));
dttable.Columns.Add("resnum", typeof(Int32));
dttable.Columns.Add("sname", typeof(String));
dttable.Columns.Add("name", typeof(String));
dttable.Columns.Add("qty", typeof(Decimal));
dttable.Columns.Add("rate", typeof(Decimal));
var rows = from mobjbmast in Context.bmasts.AsEnumerable()
join mobjbtran in Context.btrans
on mobjbmast.billno equals mobjbtran.billno
join mobjwaiter in Context.waiters
on mobjbmast.scode equals mobjwaiter.code
where mobjbmast.billno == mbillno
let billarray = new object[]
{
mobjbmast.billno,
mobjbmast.date,
mobjbmast.time,
mobjbmast.covers,
mobjbmast.trcode,
mobjbmast.scode,
mobjbmast.gname,
mobjbmast.total,
mobjbmast.login,
mobjbmast.resno,
mobjbmast.custcode,
mobjbmast.resnum,
mobjwaiter.name,
mobjbtran.name,
mobjbtran.qty,
mobjbtran.rate
}
select billarray;
foreach (var array in rows)
{
dttable.Rows.Add(array);
}