title: Exception throws There is no row at position 0
body: <p>I wanted to check user is valid or not.it gives me the exception,When user valid it's working without issue,But if user invalid there's some issue.</p>
  
  <blockquote>
    <p>Exception is : There is no row at position 0</p>
  </blockquote>
  
  <p>Here is the part of the code,</p>
  
  <pre><code> public bool CheckUserExistAndReporter(string user)
  {
      int reporterDnnId = -1;
      SMSFunctionController mysms = new SMSFunctionController();
      DataSet uds = mysms.GetUsersUnitByUserName(user);
  
      reporterDnnId = Convert.ToInt32(uds.Tables[0].Rows[0]["DnnUserID"]);
      if (reporterDnnId &gt; 0)
      {
          bool isValidUser = true;
          return isValidUser;
      }
      //else
      //{
          //bool isValidUser =false;
          //return isValidUser;
     // }
      return false;
  }
  </code></pre>
  
  <p>Then i call thatone here.</p>
  
  <pre><code>                if (!CheckUserExistAndReporter(user))
                  {
                      ErrorLog(messageIn);
                      msgOut = "ugyldig Bruker";//Invalid User.
  
                  }
  </code></pre>
  
  <p>what is the error ?</p>