在assign.aspx页面中我有
foreach (ListItem li in CheckBoxList1.Items)
{
if (li.Selected)
{
str1+=li.Value+" ";
}
}
sql = " insert into assgnmovie values ('"+mvnm+"','"+thnm+"','"+date+"','"+str1+"')";
SqlDatabase.Insert(sql);
} 现在在 booking.aspx 页面
protected void ddlMov_SelectedIndexChanged(object sender, EventArgs e)
{
DataSet ds = new DataSet();
SqlDataAdapter adp = new SqlDataAdapter("select thname from assgnmovie where mvname='"+ddlMov.SelectedItem.Value+"'",con);
adp.Fill(ds);
ddlTheater.DataSource = ds;
ddlTheater.DataValueField = "thname";
ddlTheater.DataBind();
ddlTheater.Items.Insert(0, new ListItem("SELECT", "0"));
}
protected void ddlTheater_SelectedIndexChanged(object sender, EventArgs e)
{
DataSet ds = new DataSet();
SqlDataAdapter adp = new SqlDataAdapter("select showtime from assgnmovie where mvname='"+ddlMov.SelectedItem.Value+"' and thname='"+ddlTheater.SelectedItem.Value+"'",con);
String a = adp.ToString();
String b = a.Substring(1, 6);
ddlShow.Text = b;
adp.Fill(ds);
我如何拆分字符串并将单词作为 ddlshow.list 的数据集???