Click here to Skip to main content
15,894,955 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
protected void BtnCheck_Click(object sender, EventArgs e)
        {
            if (GridView1.Rows.Count ==0)
            {
                Label1.Visible = true;
                Label1.Text = "CLICK NEW EMPLOYEE TO REGISTER PLEASE!!";
                HyperLink1.Visible = true;
            }
            else
            {
                SqlDataAdapter da = new SqlDataAdapter("select empno,Namee from employee where Namee='" + TextBox1.Text + "'", con);
                DataSet ds = new DataSet();
                da.Fill(ds, "employee");
                DataView dv = new DataView(ds.Tables["employee"]);
                GridView1.DataSource = dv;
                GridView1.DataBind();                
            }
            
            
        }
Posted
Updated 27-Mar-13 11:25am
v2
Comments
joshrduncan2012 27-Mar-13 17:25pm    
Why doesn't it work? What are you getting as output? What errors are you getting? Just saying "it doesn't work" doesn't help us at all.
Richard C Bishop 27-Mar-13 17:27pm    
If it is empty you want to show the link and label?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900