protected void TradesDropDown_ValueSelect(object sender, Syncfusion.JavaScript.Web.DropdownListEventArgs e)
{
Session["ShipCity"] = e.Value;
}
protected void btn_Click(object Sender, Syncfusion.JavaScript.Web.ButtonEventArgs e)
{
string selected = Session["ShipCity"].ToString();
dt = new DataTable("Order");
cmd.Connection = myConnection;
cmd.CommandText = "select [CustomerID] from [Orders] where [ShipCity]='" + selected + "'";
cmd.CommandType = CommandType.Text;
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = cmd;
if ((myConnection.State == ConnectionState.Closed))
{
myConnection.Open();
}
da.Fill(dt);
Session["NewDataSource"] = dt;
DropDownList1.DataSource = Session["NewDataSource"];
} |