title: Column NameStudent repeats the first element from a database table in a column dataGrid
body: <p>i created a separate class ListStudents to output the name of students but only 1 name is repeated</p>
  <pre><code>class ListStudents : ObservableCollection&lt;Student&gt;
      {
          public static TitleStudentEntities DataStudent { get; set; }
          public ListStudents()
          {
              {
                  var student = PageAttendance.DataStudent.Students;
                  var queryStudent = student.OrderBy(x =&gt; x.name);
                  foreach (Student emp in queryStudent)
                  {
                      this.Add(emp);
  
                  }
  
              }
          }
      } 
  </code></pre>
  <p>Class PageAttendace. here I am displaying the number of hours missed by students.</p>
  <pre><code>public partial class PageAttendance : Page
      {
          public static TitleStudentEntities DataAttendance { get; set; }
         public static TitleStudentEntities DataStudent { get; set; }
          ObservableCollection&lt;Attendance&gt; ListAttendance;
          ObservableCollection&lt;Student&gt; ListStudent;
  
          public PageAttendance()
          {
              DataAttendance = new TitleStudentEntities();
             DataStudent = new TitleStudentEntities(); 
              InitializeComponent();
              ListAttendance = new ObservableCollection&lt;Attendance&gt;();
              ListStudent = new ObservableCollection&lt;Student&gt;();
          }
  
          private void Page_Loaded(object sender, RoutedEventArgs e)
          {
              var attendance = DataAttendance.Attendances;
              var queryAttendance = attendance.OrderBy(x =&gt; x.skippedHours);
              foreach (Attendance emp in queryAttendance)
              {
                  ListAttendance.Add(emp);
  
              }
              DataGridAttendance.ItemsSource = ListAttendance;
          }
        
  
      }
      
  }
  </code></pre>
  <p>this is how the column binding in xaml.</p>
  <pre><code>&lt;DataGridTextColumn   Header=&quot;nameStudent&quot;  Binding=&quot;{Binding name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Source={StaticResource listStudents1}}&quot;   Width=&quot;200&quot;/&gt;
  </code></pre>