난 내가하지, 내가 IQueryable
로 변경 데이터베이스를 사용하고 있기 때문에 그가반환 된 IQueryable <string>
// in this case we return IEnumerable<string>, but in most
// - DB situations you'll want to return IQueryable<string>
private IEnumerable<string> GetStuffFromDatabase()
{
var sampleData = new StreamReader(Server.MapPath("~/App_Data/Names.txt")).ReadToEnd();
return sampleData.Split('\n');
}
을 가지고 자신의 예에 pageList (트로이 굿에 의해 만들어진 하나)를 사용하지만 해요 데이터베이스에서 데이터를 반환하기 위해 내부에 무엇을 쓸 알고, 내가 ~/App_Data/DatabaseName.sdf의 경로를 변경 시도했지만 sampleData.Split('\n');
cannot implicitly convert type string to system.linq.iqueryable<string>
내가 어떻게 변경할 수 있습니다 내가 얻을?
로 돌아'공공 ActionResult 지수 (INT? 페이지를 필요) { var listPaged = GetPagedNames (page); if (listPaged == null) { return HttpNotFound(); } ViewBag.Names = listPaged; 반환보기 (db.Productos.ToList()); }' – Ivelisse
줘 "사용자 코드에 의해 DataException이 처리되지 않았습니다. 데이터베이스를 초기화하는 중에 예외가 발생했습니다. 자세한 내용은"내부 오류를 참조하십시오. "이 줄의 행에서이 오류가 나타납니다. return view (db.Productos.ToList()); ' – Ivelisse
아마도 우리가 당신을 도울 수 있도록하기 위해 실제로 작업하고있는 코드를 반영하도록 질문의 코드를 변경해야합니다. – Rune