protected void Button1_Click(object sender, EventArgs e)
{
string SQL = "select * from AllItems where 1=1";
if (!string.IsNullOrEmpty(this.TextBox1.Text))
{
SQL = SQL + " and BianHao='" + this.TextBox1.Text + "'";
}
if (!string.IsNullOrEmpty(this.TextBox2.Text))
{
SQL = SQL + " and MingCheng='" + this.TextBox2.Text + "'";
}
DataSet ds = DBHelper.GetDataSet(SQL);
this.GridView1.DataSource = ds.Tables[0];
this.GridView1.DataBind();//这句提示在选定的数据源上未找到名为“Title”的字段或属性,但是这个表和Title没有关系,.net页面上也没有有关Title的东西
}
这个要怎么改呢?
.net中从数据库中查询数据的问题!!求高手指教~
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
2条回答
悬赏问题
- ¥50 汇编语言除法溢出问题
- ¥65 C++实现删除N个数据列表共有的元素
- ¥15 Visual Studio问题
- ¥15 state显示变量是字符串形式,但是仍然红色,无法引用,并显示类型不匹配
- ¥20 求一个html代码,有偿
- ¥100 关于使用MATLAB中copularnd函数的问题
- ¥20 在虚拟机的pycharm上
- ¥15 jupyterthemes 设置完毕后没有效果
- ¥15 matlab图像高斯低通滤波
- ¥15 针对曲面部件的制孔路径规划,大家有什么思路吗