title: How to check duplicate rows in dataset?
body: <p><img src="https://i.stack.imgur.com/GQgE1.png" alt="enter image description here"></p>
  
  <p>I have a dataset which has duplicate rows i want my error message to execute when duplicate rows are present.</p>
  
  <p>Below is my code please help</p>
  
  <pre><code>DataSet dsXml = new DataSet();
  
  dsXml.ReadXml(new XmlTextReader(new StringReader(xml)));
  Hashtable hTable = new Hashtable();
  ArrayList duplicateList = new ArrayList();
  foreach (DataRow drow in dsXml.Tables[0].Rows)
  {
      if (hTable.Contains(drow))
      {
          duplicateList.Add(drow);
      }
      else
      {
          script.Append("alert('Error - There are some Duplicate entries.'); ");
          ErrorOcc = true;
          if (ErrorOcc)
          {
              this.ScriptOutput = script + " ValidateBeforeSaving = false;";
              this.StayContent = "yes";
              return;
          }
      }
  }
  </code></pre>