//查找 private void btnFind_Click(object sender, EventArgs e) { //dgvUser.DataSource = AdminManage.FindUserByAdmin(tboxFind.Text.ToString()); if (tboxFind.Text == "") { MessageBox.Show("内容不能为空"); return; } DataTable dt = AdminManage.FindUserByAdmin(tboxFind.Text.ToString()); if (dt.Rows.Count != 0) { dgvUser.DataSource = dt; } else { MessageBox.Show("抱歉,没有找到!"); tboxFind.Text = ""; } }