title: How to update data faster in sql using c#
body: <p>I want to update my database but I think my code takes a lot of time in doing it. It takes about 20secs or more in updating. Is it possible to make it faster? If so please help me.</p>
  
  <p>This is my code:</p>
  
  <pre><code>for (int i = 0; i &lt; listView1.Items.Count; i++)
          {
              if (listView1.Items[i].SubItems[13].Text.ToString() == ("ACTIVE") || listView1.Items[i].SubItems[13].Text.ToString() == ("Active"))
              {
                  for (int x = 0; x &lt; listView1.Items[i].SubItems.Count; x++)
                  {
                  string a = listView1.Items[i].SubItems[7].Text;
                  TimeSpan time = Convert.ToDateTime(DateTime.Now.ToString("MMMM dd, yyyy")) - Convert.ToDateTime(a.ToString());
                  int days = (int)time.TotalDays;
                  listView1.Items[i].SubItems[11].Text = days.ToString() + " day(s)";
                  Class1.ConnectToDB();
                  Class1.sqlStatement = "Update tblhd set aging = '" + days.ToString() + " day(s)" + "'";
                  Class1.dbcommand = new SqlCommand(Class1.sqlStatement, Class1.dbconnection);
                  Class1.dbcommand.ExecuteReader();
                  }
              }
              }
  </code></pre>