111,125
社区成员
发帖
与我相关
我的任务
分享
protected void Button1_Click(object sender, EventArgs e)
{
string cx = "select * from shetuanxinxi where sno='" + TextBox1.Text + "'";
SqlDataSource1.SelectCommand = cx;
this.GridView1.EmptyDataText = "查询无结果,请重新输入查询条件!";
GridView1.DataSourceID = "SqlDataSource1";
GridView1.DataBind();
} protected void Button1_Click(object sender, EventArgs e)
{
string cx1 = "select * from shetuanxinxi where sno" + DropDownList1.SelectedValue + "'" + TextBox1.Text + "'";
SqlDataSource1.SelectCommand = cx1;
string cx2 = "select * from shetuanxinxi where sname ='" + TextBox2.Text + "'";
SqlDataSource1.SelectCommand = cx2;
string cx3 = "select * from shetuanxinxi where stype ='" + TextBox3.Text + "'";
SqlDataSource1.SelectCommand = cx3;
this.GridView1.EmptyDataText = "查询无结果,请重新输入查询条件!";
GridView1.DataSourceID = "SqlDataSource1";
GridView1.DataBind();
}
这样查询不了