Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
An exception error
Siyabonga Mthethwa
Jul 27 2015 4:40 AM
406
i have a above code on my
controller
,
public ActionResult Details(int? id)
{
var dbo = new DrugBusiness();
DrugModel dm = dbo.DetailsMethod(id);
DateTime drug_expdate = dbo.GetAll().Find(x => x.DrugId == id).ExpiryDate;
DateTime now = DateTime.Today;
var days = drug_expdate - now;
if(drug_expdate<=now)
{
ViewBag.msg = "The Drug has
expired
";
}
else
{
ViewBag.msg = "This Drug
expires
in " + days.Days + "Days";
}
return
PartialView(dbo.DetailsMethod(id));
but when im running my Details view it's giving me an error in yellow line, this what it says "{"Object reference not set to an instance of an object."}"
please help me ive try but nothing is
working
, please
Reply
Upload Source Code
Select only zip and rar file.
Post
Reset
Answers (
1
)
how can i kill any app through c# from remote machine
Databse server UserID Password thorugh any win form app c#