private void BindStudentsData() { DBLayer db = new DBLayer(); DataSet ds = new DataSet(); ds = db.SearchStudents(Convert.ToInt32(uiDropDownListClasses.SelectedValue), Convert.ToInt32(uiDropDownListClassRooms.SelectedValue), uiTextBoxSearchText.Text); uiGridViewStudents.DataSource = ds; uiGridViewStudents.DataBind(); }
private void BindData() { DBLayer db = new DBLayer(); DataSet ds = new DataSet(); if (!string.IsNullOrEmpty(uiDropDownListClasses.SelectedValue) && !string.IsNullOrEmpty(uiDropDownListClassRooms.SelectedValue)) { ds = db.SearchStudents(Convert.ToInt32(uiDropDownListClasses.SelectedValue), Convert.ToInt32(uiDropDownListClassRooms.SelectedValue), uiTextBoxSearchText.Text); } if (ds.Tables.Count > 0) { uiGridViewStudents.DataSource = ds; } else { uiGridViewStudents.DataSource = null; } uiGridViewStudents.DataBind(); }