using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient;

public partial class ViewProfile : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            setEmployees();
        }
       
    }
    SqlConnection con = new SqlConnection(ConfigurationSettings.AppSettings.Get("con"));
    private void setEmployees()
    {
        if (con.State == ConnectionState.Closed) con.Open();
        SqlDataAdapter da = new SqlDataAdapter("select * from emp where empno=" + Session["eid"], con);
        DataSet ds = new DataSet();
        da.Fill(ds, "emp");
        DataGrid1.DataSource = ds.Tables[0];
        DataGrid1.DataBind();
    }
    protected void DataGrid1_PageIndexChanged(object source, DataGridPageChangedEventArgs e)
    {
        DataGrid1.CurrentPageIndex = e.NewPageIndex;
        setEmployees();
    }
    protected void DataGrid1_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
}
