What you want to see on DotNetFunda.com ?
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 20447 |  Welcome, Guest!   Register  Login
 Home > Forums > ASP.NET AJAX > Null reference exception ...
Prasanna64

Null reference exception

Replies: 0 | Posted by: Prasanna64 on 5/9/2012 | Category: ASP.NET AJAX Forums | Views: 570 | Status: [Member] | Points: 10  


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>
}


Reply | Reply with attachment | Alert Moderator

 Responses below this adGet hundreds of .NET Tips and Tricks videos

  No reply found.


Reply - Please login to reply


Click here to login & reply

Found interesting? Add this to:


 Latest Posts

Write New Post | More ...

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/23/2013 2:12:58 AM