public void GetProjectName() { DataSet dsEmpLists = objProjDets.DisplayProjectTypes(); if (dsEmpLists.Tables[0].Rows.Count > 0) { ddlProjectName.DataTextField = dsEmpLists.Tables[0].Columns["Title"].ToString(); // text field name of table dispalyed in dropdown ddlProjectName.DataValueField = dsEmpLists.Tables[0].Columns["ProjectId"].ToString(); // to retrive specific textfield name ddlProjectName.DataSource = dsEmpLists.Tables[0]; //assigning datasource to the dropdownlist ddlProjectName.DataBind(); //binding dropdownlist ddlProjectName.Items.Insert(0, new ListItem("--Select--", "0")); } }
//Display All Projects public void DisplayApplication() { DataSet dsAppn = objproject.DisplayProjectTypes(); if (dsAppn.Tables[0].Rows.Count > 0) { GVApplicationReports.DataSource = dsAppn.Tables[0]; GVApplicationReports.DataBind(); } else { lblMsg.Visible = true; lblMsg.Text = "No Data Avaliable"; } }