数据源的类型无效。它必须是 IListSource、IEnumerable 或 IDataSource。 10
protectedvoidButton3_Click(objectsender,EventArgse){DataSetds=newDataSet();SQLHelperh...
protected void Button3_Click(object sender, EventArgs e)
{
DataSet ds = new DataSet();
SQLHelper hh = new SQLHelper();
if (DropDownList1.SelectedValue == "查询全部")
{
SqlParameter[] prams = { };
ds = hh.ExecuteDataSet("tblNews_GetAll", prams);
}
if (DropDownList1.SelectedValue == "按编号查询")
{
int NewsId = Convert.ToInt32(TextBox1.Text);
SqlParameter[] prams = {
new SqlParameter("@NewsId",SqlDbType.Int)
};
prams[0].Value = NewsId;
ds = hh.ExecuteDataSet("tblNews_GetId", prams);
}
if (DropDownList1.SelectedValue == "按时间查询")
{
DateTime NewsTime = Convert.ToDateTime(TextBox1.Text);
SqlParameter[] prams = {
new SqlParameter("@NewsTime",SqlDbType.DateTime)
};
prams[0].Value = NewsTime;
ds = hh.ExecuteDataSet("tblNews_GetTime", prams);
}
if (DropDownList1.SelectedValue == "按标题查询")
{
string NewsTitle = TextBox1.Text;
SqlParameter[] prams = {
new SqlParameter("@NewsTitle",SqlDbType.NVarChar)
};
prams[0].Value = NewsTitle;
ds = hh.ExecuteDataSet("tblNews_GetTitle", prams);
}
if (DropDownList1.SelectedValue == "按作者查询")
{
string NewsAuthor = TextBox1.Text;
SqlParameter[] prams = {
new SqlParameter("@NewsAuthor",SqlDbType.NVarChar)
};
prams[0].Value = NewsAuthor;
ds = hh.ExecuteDataSet("tblNews_GetAuthor", prams);
}
GridView1.DataSource = hh;
GridView1.DataBind(); 展开
{
DataSet ds = new DataSet();
SQLHelper hh = new SQLHelper();
if (DropDownList1.SelectedValue == "查询全部")
{
SqlParameter[] prams = { };
ds = hh.ExecuteDataSet("tblNews_GetAll", prams);
}
if (DropDownList1.SelectedValue == "按编号查询")
{
int NewsId = Convert.ToInt32(TextBox1.Text);
SqlParameter[] prams = {
new SqlParameter("@NewsId",SqlDbType.Int)
};
prams[0].Value = NewsId;
ds = hh.ExecuteDataSet("tblNews_GetId", prams);
}
if (DropDownList1.SelectedValue == "按时间查询")
{
DateTime NewsTime = Convert.ToDateTime(TextBox1.Text);
SqlParameter[] prams = {
new SqlParameter("@NewsTime",SqlDbType.DateTime)
};
prams[0].Value = NewsTime;
ds = hh.ExecuteDataSet("tblNews_GetTime", prams);
}
if (DropDownList1.SelectedValue == "按标题查询")
{
string NewsTitle = TextBox1.Text;
SqlParameter[] prams = {
new SqlParameter("@NewsTitle",SqlDbType.NVarChar)
};
prams[0].Value = NewsTitle;
ds = hh.ExecuteDataSet("tblNews_GetTitle", prams);
}
if (DropDownList1.SelectedValue == "按作者查询")
{
string NewsAuthor = TextBox1.Text;
SqlParameter[] prams = {
new SqlParameter("@NewsAuthor",SqlDbType.NVarChar)
};
prams[0].Value = NewsAuthor;
ds = hh.ExecuteDataSet("tblNews_GetAuthor", prams);
}
GridView1.DataSource = hh;
GridView1.DataBind(); 展开
威孚半导体技术
2024-08-19 广告
2024-08-19 广告
威孚(苏州)半导体技术有限公司是一家专注生产、研发、销售晶圆传输设备整机模块(EFEM/SORTER)及核心零部件的高科技半导体公司。公司核心团队均拥有多年半导体行业从业经验,其中技术团队成员博士、硕士学历占比80%以上,依托丰富的软件底层...
点击进入详情页
本回答由威孚半导体技术提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询