protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.IsPostBack)
     {
         FillGrid();
         BindDll();
         DDLEmp.Focus();
     }
 }
    public void GetLocations()
    {
        // var empcd = Session["empcode"].ToString();
        try
        {
            SqlConnection con = new SqlConnection(strcon);
            SqlCommand    cmd = new SqlCommand();
            cmd.CommandText = "inCore.dbo.usp_ITAssets_Ins";
            cmd.Parameters.AddWithValue("@Flag", "GetITAssets");
            var empcd = Convert.ToString(Session["empcode"]);
            cmd.Parameters.AddWithValue("@empcd", empcd);
            cmd.CommandTimeout = 0;
            cmd.CommandType    = CommandType.StoredProcedure;
            SqlDataAdapter adpt = new SqlDataAdapter(cmd);
            cmd.Connection     = con;
            adpt.SelectCommand = cmd;
            DataSet ds = new DataSet();
            adpt.Fill(ds);

            DDLLoc.DataSource    = ds.Tables[0];
            DDLLoc.DataTextField = "locationname";
            DDLLoc.DataBind();
            DDLLoc.Items.Insert(0, new ListItem("SELECT", ""));

            DDLAtype.DataSource    = ds.Tables[1];
            DDLAtype.DataTextField = "AssetTypeDesc";
            DDLAtype.DataBind();
            DDLAtype.Items.Insert(0, new ListItem("SELECT", ""));

            DDLMdl.DataSource    = ds.Tables[2];
            DDLMdl.DataTextField = "AssetTypeDesc";
            DDLMdl.DataBind();
            DDLMdl.Items.Insert(0, new ListItem("SELECT", ""));

            DDLMake.DataSource    = ds.Tables[3];
            DDLMake.DataTextField = "AssetTypeDesc";
            DDLMake.DataBind();
            DDLMake.Items.Insert(0, new ListItem("SELECT", ""));


            DDLOS.DataSource    = ds.Tables[4];
            DDLOS.DataTextField = "AssetTypeDesc";
            DDLOS.DataBind();
            DDLOS.Items.Insert(0, new ListItem("SELECT", ""));

            DDLOffce.DataSource    = ds.Tables[5];
            DDLOffce.DataTextField = "AssetTypeDesc";
            DDLOffce.DataBind();
            DDLOffce.Items.Insert(0, new ListItem("SELECT", ""));

            DDLRam.DataSource    = ds.Tables[6];
            DDLRam.DataTextField = "AssetTypeDesc";
            DDLRam.DataBind();
            DDLRam.Items.Insert(0, new ListItem("SELECT", ""));

            DDLHD.DataSource    = ds.Tables[7];
            DDLHD.DataTextField = "AssetTypeDesc";
            DDLHD.DataBind();
            DDLHD.Items.Insert(0, new ListItem("SELECT", ""));

            DDLEmp.DataSource    = ds.Tables[8];
            DDLEmp.DataTextField = "EMPNM";
            DDLEmp.DataBind();
            DDLEmp.Items.Insert(0, new ListItem("SELECT", ""));
        }
        catch (Exception ex)
        {
        }
    }