if (!IsPostBack) { HttpCookie cookie = Request.Cookies.Get("Location"); if (cookie != null) { DataTable StateDT = new DataTable(); using (SqlConnection con2 = new SqlConnection(ConfigurationManager.ConnectionStrings["BeravaConnectionString"].ConnectionString)) { // Create the SelectCommand. SqlCommand command = new SqlCommand("SELECT State FROM State WHERE Country = @Location", con2); command.Parameters.AddWithValue("@Country", cookie); var Location = cookie.Value; SqlDataAdapter adaptar = new SqlDataAdapter(); adaptar.SelectCommand = command; adaptar.Fill(StateDT); carstatedrdolst.DataSource = StateDT; carstatedrdolst.DataTextField = "State"; carstatedrdolst.DataBind(); } carstatedrdolst.Items.Insert(0, new ListItem("Select State", "")); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)