Answer the question
In order to leave comments, you need to log in
How to implement delete and lookup in WPF DataGrid table?
I am writing a client-server application. It is necessary to implement search and delete in the table. The data in the table is displayed through the list List.
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;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question