title: I would like to display data from a database in an MVC project using sql adapter
body: <p>I am looking to use the SQL Data adapter feature inside of MVC to display the results from a query string inside of my project. I'm new to using the sql adapter feature but I would like to get used to it. Simply put, I need to know what to put in my controller, and if i need to create a model, and what to put in my view. </p>
  
  <pre><code> using System;
   using System.Collections.Generic;
   using System.Linq;
   using System.Web;
   using System.Web.Mvc;
   using System.Data;
   using System.Data.SqlClient;
   using System.Configuration;
  
  
   namespace NewHoyaIntranet.Controllers
   {
  public class HomeController : Controller
  {
      public ActionResult Index()
      {
          DataSet data;
          DataTable table;
          using (SqlConnection connection = new 
  
  
  
    SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["HUT"]
    .ConnectionString))
          {
              connection.Open();
  
              SqlCommand select = new SqlCommand("SELECT * FROM HUT.dbo.XREF_HIOI_LensStyle_HTL", connection);
  
              SqlDataAdapter adapter = new SqlDataAdapter();
              adapter.SelectCommand = select;
  
              data = new DataSet();
              adapter.Fill(data, "HUT.dbo.XREF_HIOI_LensStyle_HTL");
  
              table = data.Tables[0]; //is the [0] really correct?
          }
  
          return View(/* Right now nothing is returning in any view/ how do i tie the view in? */);
  
      }
  }
  </code></pre>
  
  <p>}</p>