Click here to Skip to main content
15,943,477 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
When i am connecting to the database with my model values then this error is getting. Can any one help me out

here is my code:

public override List<appdto> Appointmentlist(int id)
{
List<appdto> dto = new List<appdto>();
List<appointment> db = _db.Appointments.Where(p => p.DID==id).ToList();
foreach (var s in db)
{
var app = new AppDto();
app.PID = s.PID;
app.Title = s.Title;
app.Length = s.Length;
app.AppDate = s.AppDate;

dto.Add(app);
}

return dto;

}
Posted

1 solution

can you try to change in view using @model to @model IEnumerable<your model="">
where you bind your current model.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900