title: Update Values in Database - MVC
body: <p>im using the sortable jquery plugin, because i want that the user can choice the order of the images are showing in my view.</p>
  
  <p>For this i have a Get Controller which sends the data to my PartialView.</p>
  
  <p>How can i make the now the Post Controller to update my table in my database?</p>
  
  <p>Note: In this moment the controller don´t receive any data. i haven´t figured out what is wrong</p>
  
  <p>Someone can help me with this?</p>
  
  <p>Thanks in advance:</p>
  
  <p>Here is my code:</p>
  
  <p><strong>In My PartialView:</strong></p>
  
  <pre><code>@(Html.BeginForm("UpdateOrder", "Admin", FormMethod.Post)){
              &lt;div id="Order"&gt;
                  &lt;ul id="sortable"&gt;
  
                      @foreach (var p in ViewBag.Images)
                      {           
                          &lt;li id="@Html.AttributeEncode(p.FileName)"&gt;
                              &lt;img src="~/Files/@p.FileName"/&gt;
                          &lt;/li&gt;
                       }
                  &lt;/ul&gt;
              &lt;/div&gt;
           }
  </code></pre>
  
  <p><strong>Controller:</strong></p>
  
  <pre><code>if (ModelState.IsValid)
  {
      using (SqlConnection cn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString))
      {
           SqlCommand cmd;
           System.Text.StringBuilder sql = new System.Text.StringBuilder();
           sql.Append("Update Image Set MyFileName=??? Order By ASC");
  
           cn.Open();
           cmd = new SqlCommand(sql.ToString(), cn);
           cmd.Parameters.Add(??????????).Value = ;
  
           cmd.ExecuteNonQuery();
  
           cn.Close();
       }
  }      
  return View();
  </code></pre>