Null reference exception

Posted by Prasanna64 under ASP.NET AJAX on 5/9/2012 | Points: 10 | Views : 1635 | Status : [Member] | Replies : 0
Hi,
i got an error null reference exception was unhandled by unuser code.iam developing an application in asp.net mvc 3
my controller code
public ActionResult Index()
{
ViewBag.Message = "Welcome to ASP.NET MVC!";
var de =


from i in dbContext.Usr_trainings
where i.Usr_training_id == 1
select i;


return View(de);
}
my view code


@model IEnumerable<OpenAccessModel1.Usr_training>

i give this reference
and retrieve the data using



@foreach (var item in Model)
{
<p>
@item.Usr_training_name

</p>
}




Responses

(No response found.)

Login to post response