Display data from database based on condition in mvc4 with linq

Posted by Mandlaa under ASP.NET MVC on 10/16/2013 | Points: 10 | Views : 2608 | Status : [Member] | Replies : 1
public ActionResult Details(string id)
{

sample styles = db.samples.Single(x => x.AccNo == id);

return View(styles);
}

I want to display data based on AccNo(Value)

localhost:1652/Home/Details/123abc

but i am getting this error

what is the mistake in my code

ERRor:

An exception of type 'System.InvalidOperationException' occurred in System.Data.Linq.dll but was not handled in user code




Responses

Posted by: Mandlaa on: 10/16/2013 [Member] Starter | Points: 25

Up
0
Down
plz anyone tell me wat is the wrong in my code,
plz helpme

Mandlaa, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response