//查询 private void QueryBtn_Click(object sender, RoutedEventArgs e) { string keyword = Keyword.Text; List <Teacher> teachers = dbUtill.QueryMember(keyword); if (teachers.Count > 0) { MemberDataGrid.ItemsSource = teachers; } else { System.Windows.MessageBox.Show("您查询的用户不存在,请检查后重新输入", "提示"); } }