TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Mark Tabor
581
2k
465k
Invalid column name ‘Course_Tags’. in razor View
Jan 17 2020 10:47 AM
Hi I am having a mvc web application in which I have four tables and i am using below linq query to get all columns from all tables and i inspect it using debugging it is getting all data from all four tables ,
var dept = from s
in
db.Teacher_courses
join ce
in
db.Courses on s.CourseId equals ce.Course_Id
join se
in
db.Semesters on s.Semester_Id equals se.Semester_Id
join re
in
db.Registration on s.Teacher_Id equals re.User_Id
where ce.Course_Id == s.CourseId
select s;
I have below Model class previously i was only getting data from Teacher_Courses Table but now I need to add more columns like semester,Registration and Courses table , so for experiment I just wrote the above query and inpect it using debugging it is getting all fields values from all tables , so I add one more property to my model class for Courses_TAGS as shown below
and i am using it in my view as shown below
<td>
@Html.DisplayFor(modelItem => item.regs.FullName)
</td>
<td>@Html.DisplayFor(modelItem => item.Course_Tags)</td>
but i am getting this below error message
Reply
Answers (
5
)
Allow Decimal & dot(.) only Once in a Textbox
Link relationship between Model, VIew and Control