I have 2 tables
first is tbl_News and 2nd is tbl_Category.
1st tables has ID,Description,Date,Status,City and CategoryID
2nd tables has Id,CategoryName.
i want to show all columns of news table but i want to show categoryName in place of CategoryID
var News = from n in tbl_News
join c in tbl_Category
on n.CategoryId equals c.CategoryID
select new {
ID = n.ID,
Description = n.Description,
Date = n.Date,
Status = n.Status,
City = n.City,
Category = c.CategoryName
}.ToList();
Here 1 got error tbl_category is type, not a valid in given context.