Exemple #1
0
    private void FillNationality()
    {
        try
        {
            tbl_CountryMasterProp Objtbl_CountryMasterProp = new tbl_CountryMasterProp();
            Objtbl_CountryMasterProp.CountryCode = 0;

            tbl_CountryMasterBAL Objtbl_CountryMasterBAL = new tbl_CountryMasterBAL();
            DataSet dsData = Objtbl_CountryMasterBAL.SelectCombo_Data();

            DataRow dr = dsData.Tables[0].NewRow();
            dr["CountryName"] = "--- Select Any ---";
            dr["CountryCode"] = 0;

            dsData.Tables[0].Rows.InsertAt(dr, 0);

            ddlNationality.DataSource     = dsData.Tables[0];
            ddlNationality.DataTextField  = "CountryName";
            ddlNationality.DataValueField = "CountryCode";
            ddlNationality.DataBind();
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
    private void LoadCountry()
    {
        tbl_CountryMasterBAL Objtbl_CountryMasterBAL = new tbl_CountryMasterBAL();
        DataSet dsData = Objtbl_CountryMasterBAL.SelectCombo_Data();

        ddlLivingIn.DataSource     = dsData.Tables[0];
        ddlLivingIn.DataTextField  = "CountryName";
        ddlLivingIn.DataValueField = "CountryCode";
        ddlLivingIn.DataBind();
    }