Q1: Was kann ich tun, um den Fehler zu beheben? Ich habe bereits ein Modell für die Daten definiert, die ich abrufen muss (siehe die folgende Modelldefinition).
Code: Select all
public JsonResult StudList()
{
string SQL = "select id, name, div_code, block, from students where ....."; //see the below model
var con = DB.GetConnection();
con.Open();
OracleDataAdapter oraAdapt = new OracleDataAdapter(SQL, con);
DataTable dt = new DataTable();
oraAdapt.Fill(dt);
con.Close();
con.Dispose();
List dtList = dt.AsEnumerable().ToList();
return Json(dtList, JsonRequestBehavior.AllowGet);
}
< /code>
Modell: < /p>
public class GetSDetailsModel
{
public List GetStudentSearchModel { get; set; }
}
public class GetStudentSearchModel
{
public string id { get; set; }
public string name { get; set; }
public string div_code { get; set; }
public string level_code { get; set; }
public string program_code { get; set; }
public string major_code { get; set; }
public string PGPA { get; set; }
}