title: Check the number of rows updated
body: <p>hey, i made db connection in C# with SQL but there is some drawbacks which i want to cover it. e.g. when i update even if there if no record it will not show an error also will not UPDATE. Same case with DELETE.</p>
  
  <pre><code>private void button3_Click(object sender, EventArgs e)
  {
      setData();
      bool flag = db.UpdateData("UPDATE trytb SET Name = '"+dc.Name+"' WHERE ID = '"+dc.ID+"'");
      if (flag)
          MessageBox.Show("Record Updated");
      else
          MessageBox.Show("Not Updated");
  }
  
  public bool DeleteData(string qry)
  {
      try
      {
          conn.Open();
          SqlCommand cmd = new SqlCommand(qry, conn);
          cmd.ExecuteNonQuery();
          flag = true;
          conn.Close();
          return flag;
      }
      catch
      {
          return flag;
      }
  }
  </code></pre>