//請各位大蝦幫幫忙弄了我好多天了 DataContext con = new DataContext(); Survey entity = null;//接收的實體對象 DataLoadOptions dl = new DataLoadOptions(); dl.LoadWith<Survey>(c => c.SurveyAnswers);//關聯SurveyAnswers表 con.LoadOptions = dl; entity = (from su in con.Surveys //where中我想讓SurveyAnswers表的id等于傳過來的id where su.ID == ID //&& SurveyAnswers.ID == AnswerID select su).SingleOrDefault();
添加回答
舉報
0/150
提交
取消