I have a VS 2010, MVC, VS 2005
I am creating a .dbml file as my model. Map table inside .dbml file
I use SQL from LINQ To join tax tables, I want to display a record of two tables i.e. tbl_class, tbl_subject
CODE looks like this in my controller
< Code> Public Action Topic Teacher () {var DataContext = New SMSAPPDataContext (); Var resultclass = (from DataContext.tbl_teachers in DataContext.tbl_teacherenrollments in DataContext.tbl_batches c from DataContext.tbl_classes in DataContext.tbl_subjects in S where t.Teacher_ID == E. Teacher_ID & amp; E.E.E.Batch_ID = = B.Batch_ID & amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; e.ub_id == s.Sub_ID & amp; amp; टी. TeacherName == "Select c; var resultsubject = from DataContext.tbl_teachers in DataContext.tbl_teacherenrollments in DataContext.tbl_batches in DataContext.tbl_classesDataContact .blog_subsicles where T. teacher_id ==E.teacher_ID & E. Batch_ID == b.Batch_ID & am P; amp; B.Class_ID == c.Class_ID & amp; amp; E.Sub_ID == s.Sub_ID & amp; amp; amp; amp; amp; amp; amp; ;; teacher-name ==; select "ABC"; see return ();}
Then I create a map above the two variables in the controller, that is, resultbject
public class MyViewModel {public MyViewModel (SMSAPPDataContext resultclass, SMSAPPDataContext resultubject) { This.rc = Result class; This.rs = resultsubject; } Public SMSAPPDataContext RC {get; Private set; } Public SMSAPPDataContext RS {get; Private set; }}
This category will be used to create visual in the form of a model in a strictly typed view.
But I can not understand it, what should be passed in return ??
This bus can be just like Return View (NewMovie Model);
But this gives the error, should I use the ToList () property in any place ???
If someone can tell me any other way to do this, please help
Regards
Comments
Post a Comment