title: List<> unable to hold the data of database
body: <p>I have a sql table named "Employee". The table has 4 fields: EMPLID,EMPNAME,EMPCONTACT and EMPEMAIL. I am creating a Asp.net MVC application. In my Model, I have a Users class as given below:-</p>
  
  <pre><code>Class Users
  {
      public string ID{get; set;}
      public string Name{get;set;}
      public string Contact{get;set;}
      public string Email(get;set;}
  }
  </code></pre>
  
  <p>Now Code which will take the data from the database using ado.net and send it to Controller will be given below:-</p>
  
  <pre><code>Class DatabaseAccess
  {
      public List&lt;Users&gt; GetData()
      {
          List&lt;Users&gt; eachemployee = new List&lt;Users&gt;;
          Users user = new Users();
  
          SqlConnection conn = new SqlConnection(Connectionstring);
          con.open();
          SqlDataAdapter adp = new Sql Data Adapter("Select * From Employee",conn);
          Dataset ds = new dataset();
          adp.fill(ds,"Employee");
  
          for(int i=0;i&lt;ds.tables[0].rows.count;i++) 
          {
              user.ID = ds.Tables[0].rows[i]["EMPID"].tostring(); 
              user.Name = ds.Tables[0].rows[i]["EMPNAME"].tostring();
              user.Contact = ds.Tables[0].rows[i]["EMPCONTACT"].tostring();
              user.Email = ds.Tables[0].rows[i]["EMPEMAIL"].tostring();
              eachemployee.Add(user);
         }
         return eachemployee;
     }
  </code></pre>
  
  <p>Now the problem is eachemployee always contains the rows with same data. If table has 2 rows as given below:</p>
  
  <pre><code>Emp1, Gaurav, 888888888,abc@gmail.com
  Emp2, Sharma, 999999999,xyz@gmail.com
  </code></pre>
  
  <p>Then eachemployee list contains 2 rows with the same data. That is both rows consists of Emp2 data as given below:</p>
  
  <pre><code>Emp2, Sharma, 999999999,xyz@gmail.com
  Emp2, Sharma, 999999999,xyz@gmail.com
  </code></pre>
  
  <p>How can i get out from the above issues? I didn't even know what is the reason for that?</p>