title: How to display item from database as a label text in asp.net mvc 4
body: <p>So I am trying to show some text that i retrieved from the database and wanted to show them as a label or just show up on a page. I am having trouble displaying this text and here is what i have: </p>
  
  <p>controller: </p>
  
  <pre><code>public ActionResult _StudentName(int id)
      {
          id = 12;
          var model = new StudentNameModel();
          using (var db = new School())
          {
              var result = from s in db.Students
                           where s.ID == id
                           select s.StudentName;
              model.StudentName = result.ToString();
          }
          return View(model);
      }
  </code></pre>
  
  <p>My Model: </p>
  
  <pre><code>public class StudentNameModel
  {
      [Display(Name = "Student Name")]
      public string StudentName { get; set; }
  }
  </code></pre>
  
  <p>My view: </p>
  
  <pre><code>    @model Adams.Models.StudentNameModel
       &lt;fieldset&gt;
       @Html.LabelFor(m =&gt; m.StudentName)
       @Html.TextBoxFor(m =&gt; m.StudentName)
  &lt;/fieldset&gt;
  </code></pre>