title: Updating Sql from Data in the List C# Console
body: <p>I'm Running a query and putting that data into the List, now i want to run a update query on the sql from the data in the list.</p>
  
  <pre><code>Console.WriteLine("SQL connection okay");               
  connection.Open();
  Console.WriteLine("Opened");
  string sql = "select GUID,GUSMStID  from SMS_Table where senddate &lt; GETDATE () and Status ='Active' and SMSType='MMS'";
  using (var command = new SqlCommand(sql, connection))    
  {
      using (var reader = command.ExecuteReader())
      {
          while (reader.Read())
          {
              var SMSlist = new SMSList();
              SMSlist.GUID = reader["GUID"].ToString();
              SMSlist.GUSMSID = reader["GUSMSID"].ToString();
              Console.WriteLine("Fetching SMS...", ConsoleColor.Blue);
              ListofSMS.Add(SMSlist);                               
          }
      Console.WriteLine("Fetching SMS Completed", ConsoleColor.Cyan);
  </code></pre>
  
  <p>so i have set of GUID in the list now i want to update SMS_table using those GUIDs, how to do that?</p>