public string GetCities(string tag)
        {
            DataSet ds = new DataSet();

            MySqlConnection  conn    = new MySqlConnection(ConfigurationManager.ConnectionStrings["cardleymerchantnewConnectionString"].ConnectionString.ToString());
            MySqlDataAdapter adapter = new MySqlDataAdapter();

            adapter.SelectCommand             = new MySqlCommand("getcities", conn);
            adapter.SelectCommand.CommandType = CommandType.StoredProcedure;
            adapter.SelectCommand.Parameters.AddWithValue("tag", tag);
            adapter.Fill(ds);
            List <cardleycity> cities = new List <cardleycity>();

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                cardleycity city = new cardleycity();
                city.id        = dr["cityid"].ToString();
                city.name      = dr["name"].ToString();
                city.statecode = dr["statecode"].ToString();
                city.code      = dr["citycode"].ToString();
                cities.Add(city);
            }

            JavaScriptSerializer serializer = new JavaScriptSerializer();
            string output = Newtonsoft.Json.JsonConvert.SerializeObject(cities);// serializer.Serialize(cities);

            return(output);
        }
        public string GetCities(string tag)
        {
            DataSet ds = new DataSet();

            MySqlConnection conn = new MySqlConnection(ConfigurationManager.ConnectionStrings["cardleymerchantnewConnectionString"].ConnectionString.ToString());
            MySqlDataAdapter adapter = new MySqlDataAdapter();
            adapter.SelectCommand = new MySqlCommand("getcities", conn);
            adapter.SelectCommand.CommandType = CommandType.StoredProcedure;
            adapter.SelectCommand.Parameters.AddWithValue("tag", tag);
            adapter.Fill(ds);
            List<cardleycity> cities = new List<cardleycity>();
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                cardleycity city = new cardleycity();
                city.id = dr["cityid"].ToString();
                city.name = dr["name"].ToString();
                city.statecode = dr["statecode"].ToString();
                city.code = dr["citycode"].ToString();
                cities.Add(city);
            }

            JavaScriptSerializer serializer = new JavaScriptSerializer();
            string output = Newtonsoft.Json.JsonConvert.SerializeObject(cities);// serializer.Serialize(cities);
            return output;
        }