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

Sanjeeb LenkaPosted Sep 11, 2013, 3:02 AM
in the above code where you are binding value to dropdownlist
Sanjeeb LenkaPosted Sep 11, 2013, 10:17 AM
if (ds.Tables.Count > 0)
{
dgv.DataSource = ds.Tables[0];
dgv.DataTextField="BenefitDeductionID";
dgv.DataValueField="BenefitDeductionName";
dgv.DataBind();
}
mohammed shamsheerPosted Sep 11, 2013, 9:47 AM
dgv.DataTextField="id"
dgv.DataValueField="id2"