mohammed shamsheer

mohammed shamsheer

  • NA
  • 394
  • 143.8k

Drop down not load from db

Sep 11 2013 2:56 AM


Dropdown class 

  public void LoadSelectBenefitsAndDeductionsCombo(ref DropDownList dgv)
        {
            // Code Part :6b
            //'***** Author: Mohammed Shamsheer
            //'*****  Date : 16/08/2013
            //'***** This function used to Load BenefitsAndDeductionsCombo  in web
            DataSet ds = new DataSet();
            object[,] ParmArray;
            ParmArray = new object[,] {
                {"@BranchID",BranchID}
                };
            ds = DB.ExecuteQuery_SP("SelectBenefitsAndDeductionsCombo", ParmArray);
            if (ds.Tables.Count > 0)
            {
                dgv.DataSource = ds.Tables[0];
                dgv.DataBind();
            }
        } 

------------------------------
Query for load dropdown
:
ALTER PROCEDURE [dbo].[SelectBenefitsAndDeductionsCombo]
(
@BranchID bigint
)
AS
SELECT BenefitDeductionID,BenefitDeductionName  FROM BenefitsAndDeductions WHERE BranchID=@BranchID
----------------------------------------
code behind for load drop down but itis showing 

 BenefitsAndDeductions obj = new BenefitsAndDeductions();
            obj.LoadSelectBenefitsAndDeductionsCombo(ref ddlBenefitsAndDeductionsType);


but it is showing 

Answers (3)