private void FillDataInGrid() { //try //{ string app_id = ddlApp.SelectedValue; dt = path_obj.GetDetails(app_id); if (dt.Rows.Count > 0) { GridView1.DataSource = dt; GridView1.DataBind(); } else { dt.Rows.Add(dt.NewRow()); GridView1.DataSource = dt; GridView1.DataBind(); int TotalColumns = GridView1.Rows[0].Cells.Count; GridView1.Rows[0].Cells.Clear(); GridView1.Rows[0].Cells.Add(new TableCell()); GridView1.Rows[0].Cells[0].ColumnSpan = TotalColumns; GridView1.Rows[0].Cells[0].Text = "No Record Found"; } //}catch (Exception ex) { ex.ToString(); } }
protected void LoadDataFromTable() { if (Request.QueryString["id"] != null && Request.QueryString["id"] != string.Empty) { string id = Request.QueryString["id"]; dt = path_obj.GetDetails(id); //Load data to controls string app_id = dt.Rows[0]["ApplicationId"].ToString(); ShowApp(app_id); txtPath.Text = dt.Rows[0]["Path"].ToString(); } }