1

I have two dropdownlist province and city when the province select the following cities show in the dropdownlist everything works fine the crud operations but when i debug code it's throw the exception at the end of this method "string format was not in a correct format".

private void SelectForDllCity() { try {

        clsTenantController balObj = new clsTenantController();

        balObj.tenant_province_id = Convert.ToInt32(ddlProvince.SelectedValue);
        DataTable dt = balObj.SelectForDllCity();
        if (dt.Rows.Count > 0)
        {
            ddlCity.DataSource = dt;
            ddlCity.DataTextField = "city_name";
            ddlCity.DataValueField = "city_id";
            ddlCity.DataBind();
            ddlCity.Items.Insert(0, "");
            ddlCity.SelectedIndex = 0;

        }
        else
        {

        }
    }
    catch (Exception ex)
    {

        uc_Message.ShowMessages(2, ex.Message);
    }
}

0 Answers0