connection.Open();
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "select * From Students";
cmd.Connection = connection;
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(_dataTable);
foreach (DataRow row in _dataTable.Rows)
{
StudentsList.Add(new StudentsClass
{
NumberStudents = Convert.ToString(row["Number_Students"]),
FirstName = Convert.ToString(row["First_Name_Students"]),
LastName = Convert.ToString(row["Last_Name_Students"]),
MidName = Convert.ToString(row["Mid_Name_Students"]),
Address = Convert.ToString(row["Address_Students"]),
Course = Convert.ToString(row["Course_Students"]),
BirthDay = Convert.ToString(row["Birthday_Students"])
});
}
DeportamentsGrid.ItemsSource = StudentsList;