【文件属性】:
文件名称:课程信息查询
文件大小:1.08MB
文件格式:RAR
更新时间:2019-03-08 09:16:22
查询,.NET
查询功能代码(包括普通查询和全部查询):protected void Button2_Click(object sender, EventArgs e)
{
DataSet ds = new DataSet();
DataBS(ds, strsql);
GridView1.DataSource = ds.Tables["table"];
GridView1.DataBind();
DropDownList1.SelectedValue = "不限";
DropDownList2.SelectedValue = "不限";
DropDownList3.SelectedValue = "不限";
DropDownList4.SelectedValue = "不限";
DropDownList5.SelectedValue = "不限";
Label8.Text = "查询结果: 共" + ds.Tables[0].Rows.Count + "条记录";
}
protected void Button1_Click(object sender, EventArgs e)
{
string str = "";
string str1 = "";
if (DropDownList1.SelectedItem.Text != "不限")
str += " and CourseGrade='" + DropDownList1.SelectedValue + "'";
if (DropDownList2 .SelectedItem .Text !="不限")
str +=" and CourseTerm='" + DropDownList2.SelectedValue + "'";
if (DropDownList3.SelectedItem.Text != "不限")
str += " and CourseSort='" + DropDownList3.SelectedValue + "'";
if (DropDownList4.SelectedItem.Text != "不限")
str += " and SpecialtyDirection='" + DropDownList4.SelectedValue + "'";
if (DropDownList5.SelectedItem.Text != "不限")
str += " and CourseTeacher='" + DropDownList5.SelectedValue + "'";
if (str != "")
{
str1 = str.Substring(5);
strsql += " where " + str1;
}
DataSet ds = new DataSet();
DataBS(ds, strsql);
if (ds.Tables[0].Rows.Count != 0)
{
GridView1.DataSource = ds.Tables["table"];
GridView1.DataBind();
}
else
{
Response.Write("");
GridView1.Visible = true ;
}
Label8.Text = "查询结果: 共" + ds.Tables[0].Rows.Count + "条记录";
}
【文件预览】:
InfoList
----Web.Config(2KB)
----CourseList.aspx.cs(3KB)
----Default.aspx.cs(383B)
----App_Data()
--------SearchCourse_log.ldf(1024KB)
--------SearchCourse(1.46MB)
--------SearchCourse.mdf(3MB)
----Default.aspx(445B)
----CourseList.aspx(7KB)