我有两张桌子,我制作了一张视图
我的视图名称是ViewMix
此代码适用于我的表格
var Qsearch = db.tbl_lessons.SqlQuery("select * from tbl_lessons where eTeacher in (" + teacher + ")");
这是正确的
现在我想为我的View
运行该查询我写道:
var Qsearch = db.ViewMix.SqlQuery("select * from ViewMix where eTeacher in (" + teacher + ")");
我收到错误:“无效的对象名称'ViewMix'”
我也试过了:
var Qsearch = db.ViewMix.SqlQuery("select * from dbo.ViewMix where eTeacher in (" + teacher + ")");
也有错误: “无效的对象名称'dbo.ViewMix'”
问题是什么?