I have a function that triggers a stored procedure that runs a
select * from tbl_admin where id=”..” and username=”..”
The returned output of the select statement is stored in a complex return type object spa_user_Result and stored onto a list.
I want to pass this list to the view and use it to display data, How do I do that??
code is smthing like this:
public ViewResult Index()
{
<spa_users_Result> result = new <spa_users_Result>();
System.Data.Objects.ObjectResult<spa_users_Result> r;
r = db.adminUser("s","superuser");
result = (<spa_users_Result>)r.ToList();
return View();
}
You need to pass your object(s) to the
ViewmethodAssuming your
db.adminUser("s","superuser")method returns a Collection ofspa_users_Resultobject.Make your View strongly typed to List of spa_users_Result object
Assuming your
spa_users_Resultclass has a Property calledName