private void GetHandle() { try { objAttachmentcls = new AttachmentCls(); objAttachmentcls.AttachmentHandle = Request.QueryString["ATH"]; DataTable dt = objAttachmentcls.GetALLHandleByID(); if (dt.Rows.Count > 0) { txtAttachmentHandle.Text = dt.Rows[0]["t_hndl"].ToString(); txtAcessIndex.Text = dt.Rows[0]["t_indx"].ToString(); txtTableName.Text = dt.Rows[0]["t_tabl"].ToString(); txtDescription.Text = dt.Rows[0]["t_tdes"].ToString(); txtRemarks.Text = dt.Rows[0]["t_rema"].ToString(); ddlDBID.SelectedValue = dt.Rows[0]["t_dbid"].ToString(); btnSaveHandle.Text = "Update"; txtAttachmentHandle.Enabled = false; divHeader.InnerText = "Update Attachment Handle"; } else { btnSaveHandle.Text = "Save"; } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, typeof(Page), "alert", "alert('Due to some technical issue record not found');", true); } }