计算机毕业设计介绍:
5.2.5 查询模块
当会员查看房源时,可以根据自己的需要来查询
实现方法:
如窗体中所示,上边为查询条件,下边的gridview显示结果,通过上边的的文本框的值是否为空来配置查询语句,然后简历数据集,gridview绑定到该数据集.
protected void btnReset_Click(object sender, EventArgs e)
{
this.TextBox1.Text = "";
this.TextBox2.Text = "";
this.TextBox3.Text = "";
this.TextBox4.Text = "";
this.TextBox5.Text = "";
this.TextBox6.Text = "";
this.TextBox7.Text = "";
this.TextBox8.Text = "";
this.TextBox9.Text = "";
this.TextBox10.Text = "";
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
string zhuangxiu = this.DropDownList2.SelectedItem.Text;
string yongtu = this.DropDownList1.SelectedItem.Text;
string time = System.DateTime.Now.ToString("d");
string checkboxlist = "";
for (int i = 1; i < this.CheckBoxList1.Items.Count; i++)
{
if (this.CheckBoxList1.Items[i].Selected == true )
{
checkboxlist += this.CheckBoxList1.Items[i].Text.ToString();
}
}
Sql sql = new Sql();
switch (this.RadioButtonList1.SelectedValue)
{
case "1":
{
string insertSQL = "insert into czxx(fangxing,cengshu,mianji,jianyu,zujin,sheshi,dizhi,lianxiren,dianhua,time,zhuangxiu,yongtu)values('";
insertSQL += this.TextBox1.Text + "室" + this.TextBox2.Text + "厅','";
insertSQL += "第" + this.TextBox4.Text + "层共" + this.TextBox5.Text + "层',";
insertSQL += this.TextBox3.Text + ",'";
insertSQL += this.TextBox6.Text + "年" + "',";
insertSQL += this.TextBox7.Text + ",'";
insertSQL += checkboxlist + "','";
insertSQL += this.TextBox8.Text + "','";
insertSQL += this.TextBox9.Text + "','";
insertSQL += this.TextBox10.Text + "','";
insertSQL += time + "','";
insertSQL += zhuangxiu + "','";
insertSQL +=yongtu +"')";
sql.ExcuteSQL(insertSQL);
〖资料来源:计算机毕业论文 www.xiaoniu168.com〗
第6页为计算机毕业论文部分......