You must Sign In to post a response.
  • Category: ASP.NET

    Get dropdown list for cities in India

    Hello Developers,

    I want to create a drop down list for Overall cities in India using aspx coding.
    If anyone know some link kindly refer me.

    Thanking You,
    Paul.S
  • #762729
    Hi PaulRaj,

    Didn't get your point, you want to show the cities list in dropdown right.?

    Then use below sample code

    DataSet ds=//get cities list

    ddlCities.DataSource=ds;
    ddlCities.DataTextField="CityName";
    ddlCities.DataValueField="CityId";
    ddlCities.DataBind();


    If you want total cities in india, then you need to add all those list in your database or hard code those list in your DataSet.

    Hope this will helpful to you...

    --------------------------------------------------------------------------------
    Give respect to your work, Instead of trying to impress your boss.

    N@veen
    Blog : http://naveens-dotnet.blogspot.in/

  • #762730
    Thank you mr.Naveen .

    if any query i will intimate you.

  • #763224
    Hi,

    SqlConnection Con_CheckBox = new SqlConnection(Connection);
    Con_CheckBox.Open();
    if (Chk_Male.Checked == true)
    {
    string sql = "SELECT * FROM Cities where Country='India;
    SqlDataAdapter Adb_CheckBox = new SqlDataAdapter(sql, Con_CheckBox);
    DataSet DS_Check = new DataSet();
    Adb_CheckBox.Fill(DS_Check);
    DropDown.DataSource = DS_Check;
    DropDown.DataBind();


    Hope this will help

    Regards
    Sriram.R


Sign In to post your comments