i have created a webService . i want to find last row in sql server table . how can implement that in a controller . please help.
`[ResponseType(typeof(TH_ESTIMATE_ORDER_BILL))]
public IHttpActionResult GetTH_ESTIMATE_ORDER_BILL(string id) { TH_ESTIMATE_ORDER_BILL tH_ESTIMATE_ORDER_BILL = db.TH_ESTIMATE_ORDER_BILL.Find(id); if (tH_ESTIMATE_ORDER_BILL == null) { return NotFound(); } return Ok(tH_ESTIMATE_ORDER_BILL); }
`
this to find data corresponding to an id .
like wise i want o find last row in that table
Answers
Use the following query code to get the last row.