public void search()
    {
        for (int j = 0; j < GridView2.Rows.Count; j++)
        {
            for (int i = 0; i < GridView1.Rows.Count; i++)
            {
                string str1 = GridView1.Rows[i].Cells[0].Text.TrimEnd();
                string str2 = GridView2.Rows[j].Cells[0].Text.TrimEnd();
                string job1 = GridView1.Rows[i].Cells[1].Text.TrimEnd();
                string job2 = GridView2.Rows[j].Cells[1].Text.TrimEnd();
                if (string.Compare(str1, str2) == 0)
                {
                    if (string.Compare(job1, job2) == 0)
                    {
                        seekid[n] = Convert.ToInt32(GridView2.Rows[j].Cells[2].Text);
                        n++;
                    }
                }
            }
        }

        for (int j = 0; j < n; j++)
        {
            logic l = new logic();
            Data  d = new Data();
            GridView3.DataSource = d.viewseekprofile(seekid[j]);
            GridView3.DataBind();
            l.dddegree = Convert.ToInt32(GridView3.Rows[0].Cells[3].Text);
            l.ddcourse = Convert.ToInt32(GridView3.Rows[0].Cells[4].Text);
            l.getdeg();
            l.getcou();
            fname[j]   = GridView3.Rows[0].Cells[0].Text + GridView3.Rows[0].Cells[1].Text;
            contact[j] = GridView3.Rows[0].Cells[2].Text;
            degree[j]  = Convert.ToString(Session["degree1"]);
            course[j]  = Convert.ToString(Session["course1"]);
            freshex[j] = GridView3.Rows[0].Cells[5].Text;
            year[j]    = GridView3.Rows[0].Cells[6].Text + GridView3.Rows[0].Cells[7].Text;
            resume[j]  = GridView3.Rows[0].Cells[8].Text;
            resurl[j]  = GridView3.Rows[0].Cells[9].Text;

            GridView3.Visible = false;

            Label space = new Label();
            space.Text = "&nbsp";

            LinkButton view = new LinkButton();
            view.ID = "View" + j.ToString();
            Label name = new Label();

            name.Text   = GridView3.Rows[0].Cells[0].Text + GridView3.Rows[0].Cells[1].Text;
            view.Text   = "View Profile";
            view.Click += new EventHandler(LinkButton1_Click);

            Place.Controls.Add(name);
            Place.Controls.Add(space);
            Place.Controls.Add(view);
        }
    }
    protected void btnsignin_Click(object sender, EventArgs e)
    {
        if (Jobseeker.Checked || Employer.Checked)
        {
            lblusertype.Text = "";
        }
        else
        {
            lblusertype.Text = "Choose the Field";
        }


        logic l = new logic();

        l.uname          = txtid.Text;
        l.upwd           = txtpwd.Text;
        Session["uname"] = txtid.Text;
        Session["upwd"]  = txtpwd.Text;
        l.seekuser       = txtid.Text;
        l.seekpwd        = txtpwd.Text;

        if (Jobseeker.Checked)
        {
            Session["usertype"] = 1;
            Session["name"]     = null;
            flag = l.check();
            if (flag == 1)
            {
                lblvalid.Text = "Invalid User";
            }
            else
            {
                l.viewprofile();
                l.ddnation = (int)Session["nation"];
                l.nation();
                l.ddstate = (int)Session["state"];
                l.tblstate();
                l.ddhq = (int)Session["hq"];
                l.hq();
                l.dddegree = (int)Session["degree"];
                l.getdeg();
                l.ddcourse = (int)Session["course"];
                l.getcou();
                l.dduni = (int)Session["university"];
                l.getuni();
                l.ddins = (int)Session["institute"];
                l.getins();
                l.ddyear = (int)Session["yop"];
                l.getyop();
                Response.Redirect("WelcomeSeek.aspx");
            }
        }
        else
        {
            Session["usertype"] = 2;
            flag = l.checkemp();
            if (flag == 1)
            {
                lblvalid.Text = "Invalid User";
            }
            else
            {
                l.viewprofile1();
                l.enation = (int)Session["enation"];
                l.getempnation();
                l.estate = (int)Session["estate"];
                l.getempstate();
                Response.Redirect("WelcomeEmp.aspx");
            }
        }
    }