public void GetAllVisitors(string query) { dt = new DataTable(); dt = dbClass.ConnectDataBaseReturnDT(query); if (dt.Rows.Count > 0) { GridViewAllVisitors.DataSource = dt; GridViewAllVisitors.DataBind(); } else { GridViewAllVisitors.DataSource = null; GridViewAllVisitors.DataBind(); } }
public void GetAllVisitors(string query) { string getLastFileUplaodedInfo = query; dt = new DataTable(); dt = dbClass.ConnectDataBaseReturnDT(getLastFileUplaodedInfo); if (dt.Rows.Count > 0) { GridViewAllVisitors.DataSource = dt; GridViewAllVisitors.DataBind(); } else { GridViewAllVisitors.DataSource = null; GridViewAllVisitors.DataBind(); } }
protected void btnSearchVisitor_Click(object sender, EventArgs e) { string SearchVisitor = "Select * FROM VISITOR WHERE Emp_ID='" + ddlEmployee.SelectedItem.Value.ToString() + "' ORDER BY Visitor_ID DESC ";; dt = new DataTable(); dt = dbClass.ConnectDataBaseReturnDT(SearchVisitor); if (dt.Rows.Count > 0) { GridViewAllVisitors.DataSource = dt; GridViewAllVisitors.DataBind(); } else { GridViewAllVisitors.DataSource = null; GridViewAllVisitors.DataBind(); } }