show grid dat in a popup

if (e.CommandName == "Select")
        {
            GridDataItem item = (GridDataItem)e.Item;
            string value = item["ApplicationForm_ID"].Text;
            Session["Id"] = value;

            SqlConnection con = new SqlConnection(inductionConnectionString);
            SqlCommand cmd = new SqlCommand("select * from forms.ApplicationForm where ApplicationForm_ID='" + Session["Id"] + "'", con);
       
            cmd.Connection = con;
            da = new SqlDataAdapter(cmd);
            DataTable dt = new DataTable();
            da.Fill(dt);
            lblApplicationRegNo.Text = dt.Rows[0]["ApplicationRegNo"].ToString();
            lblApplicant_Name.Text = dt.Rows[0]["Applicant_Name"].ToString();
            lblCourse_AppliedFor.Text = dt.Rows[0]["Course_AppliedFor"].ToString();
            lblApplicant_DOB.Text = Convert.ToDateTime(dt.Rows[0]["Applicant_DOB"]).ToString("MMMM dd, yyyy");  
            lblApplicant_EmailId.Text = dt.Rows[0]["Applicant_EmailId"].ToString();
            lblApplicant_MobileNo.Text = dt.Rows[0]["Applicant_MobileNo"].ToString();
            lblApplicant_FatherName.Text = dt.Rows[0]["Applicant_FatherName"].ToString();
            lblApplicant_Phone.Text = dt.Rows[0]["Applicant_Phone"].ToString();
            lblApplicant_FAX.Text = dt.Rows[0]["Applicant_FAX"].ToString();
            lblGender.Text = dt.Rows[0]["Gender"].ToString();
            image.ImageUrl= dt.Rows[0]["AttachmentPath"].ToString();
            lblApplicant_PresentAddress.Text = dt.Rows[0]["Applicant_PresentAddress"].ToString();
            lblApplicant_PinCode.Text = dt.Rows[0]["Applicant_PinCode"].ToString();
            //lblApplicant_PermanentAddress.Text = dt.Rows[0]["Applicant_PermanentAddress"].ToString();
            lblApplicant_FamilyAnnualIncome.Text = dt.Rows[0]["Applicant_FamilyAnnualIncome"].ToString();  

            string script = "function f(){$find(\"" + DetailsWindow.ClientID + "\").show(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "key", script, true);
        }

Comments

Popular posts from this blog

Create Schema Using C# Asp .Net Dynamically.

How to set Transaction and Roll Back using Entity Framework in C# Code.

How to post image in blob using Windows Azure.