求修改啊,不知道怎么回事啊

usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Web;usingSys... using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
public partial class iesearch : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
public void dlBind(string sqlstr, string table, string dkf)
{
int curpage = Convert.ToInt32(this.labPage.Text);
PagedDataSource ps = new PagedDataSource();
SqlConnection sqlconn = new SqlConnection();
sqlconn.Open();
SqlDataAdapter MyAdapter = new SqlDataAdapter(sqlstr, sqlconn);
DataSet ds = new DataSet();
MyAdapter.Fill(ds, table);
ps.DataSource = ds.Tables[table].DefaultView;
ps.AllowPaging = true;
ps.PageSize = 5;
ps.CurrentPageIndex = curpage - 1;
this.lnkbtnUp.Enabled = true;
this.lnkbtnNext.Enabled = true;
this.lnkbtnBack.Enabled = true;
this.lnkbtnOne.Enabled = true;
if (curpage == 1)
{
this.lnkbtnOne.Enabled = false;
this.lnkbtnUp.Enabled = false;
}
if (curpage == ps.PageCount)
{
this.lnkbtnNext.Enabled = false;
this.lnkbtnBack.Enabled = false;
}
this.labBackPage.Text = Convert.ToString(ps.PageCount);
this.dlInfo.DataSource = ps;
this.dlInfo.DataKeyField = dkf;
this.dlInfo.DataBind();
}
public void dlInfoBind()
{
if (ddlInfoType.Visible == false)
{
string sqlstr = "select*from tb-Info where" + ddlSCondition.SelectedValue.Trim()
+ "" + ddlSSign.SelectedValue.Trim() + "'%" + "%'";
if (!sqloperate.comBind(sqlstr))
{
Response.Write("<script>alert('没有您要查询的结果,请重新输入')</script>");
txtSKWord.Text = "";
txtSKWord.Focus();
}
else
{
this.dlDataSind(sqlstr, "tb-Info", "InfoID");
}
}
else
{
string sqlstr = "select*from tb-Info where" + ddlSCondition.SelectedValue.Trim()
+ "" + ddlSSign.SelectedValue.Trim() + "'%" + ddlInfoType.SelectValue.Trim() + "%'";
if (!sqloperate.comBind(sqlstr))
{
Response.Write("<script>alert('没有您要查询的结果,请重新输入')</script>");
txtSKWord.Text = "";
txtSKWord.Focus();
}
else
{
this.dlDataBind(sqlstr, "tb-Info", "InfoID");
}
}

}
protected void btnSearch_Click(object sender, EventArgs e)
{
this.dlInfoBind();
}

}
一个站内搜索引擎,连接SQL数据库的,用的是C#
展开
 我来答
az蓝
2012-04-08
知道答主
回答量:54
采纳率:0%
帮助的人:8.4万
展开全部
kanbudong
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式