mjoin in mvc app getting 'Object reference not set to an instance of an object.'"
mjoin in mvc app getting 'Object reference not set to an instance of an object.'"
I have loaded the demo of datatables demo into my app and it works but using my fields in the mjoin it fails. stackTrace shows
at DataTables.MJoin.Data(Editor editor, DtResponse response)
at DataTables.Editor._Get(Object id, DtRequest http)
at DataTables.Editor._Process(DtRequest data)
at DataTables.Editor.Process(DtRequest data)
at DataTables.Editor.Process(NameValueCollection data, String culture)
my mjoin looks like this.
.MJoin(new MJoin("AlternateExperience")
.Link("ClerkShipCourseTarget.TargetId", "AlternateExperiencetoTarget.ClerkshipCourseTarget_id")
.Link("AlternateExperience.id", "AlternateExperiencetoTarget.AlternateExperience_id")
.Model<JoinLinkTableModel.JoinAccessModel>()
.Order("AlternateExperience.name")
.Field(new Field("id")
.Options(new Options()
.Table("AlternateExperience")
.Value("id")
.Label("name")
)
)
)
the working mjoin looks like this.
.MJoin(new MJoin("dept")
.Link("users.id", "user_dept.user_id")
.Link("dept.id", "user_dept.dept_id")
.Model<JoinLinkTableModel.JoinAccessModel>()
.Order("dept.name")
.Field(new Field("id")
.Options(new Options()
.Table("dept")
.Value("id")
.Label("name")
)
)
)
I have even tried making the ClerkshipCourseTarget id just id and still get same error.
Answers
this is my table structure. if I remove the mjoin everything else loads fine.
should be:
We quote all identifiers, so the case is important.
Hopefully that should do it.
Allan