Hi sivanaidu,
I think you have declared the Generic List Collection of Entity Model class as the Model for the View and looping through all the column and display the record in the View.
Pass String Array from Controller to View as Model and display the record.
For this refer below article.
Check this example. Now please take its reference and correct your code.
Database
For this example I have used of Northwind database that you can download using the link given below.
Download Northwind Database
Controller
public class HomeController : Controller
{
// GET: /Home/
public ActionResult Index()
{
NorthwindEntities entities = new NorthwindEntities();
var myvalues = (from values in entities.Employees
where values.Country == "USA"
select values.FirstName).ToArray();
return View(myvalues);
}
}
View
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<string[]>" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Index</title>
</head>
<body>
<table>
<tr><th>Name</th></tr>
<% foreach (string customer in Model){ %>
<tr><td><%: customer%></td></tr>
<% } %>
</table>
</body>
</html>
Screenshot