I have another problem wherein I have a method in controller that gets a certain data and place it to the view.
Controller
public ActionResult Index()
{
var data = (from p in db.eTransactions
orderby p.id descending
select p.id).Take(1);
ViewBag.id = data;
return View();
}
View
<input type="text" value="@(ViewBag.id)"/>
instead of the data(which is a certain value) I want to get, the data thrown is like a command in an sql server
SELECT TOP (1) [Extent1].[id] AS [id] FROM [dbo].[eTransaction] AS [Extent1] ORDER BY [Extent1].[id] DESC
What is needed to do to fix this?