strCond =“ 存货名称=’DropDownList1.SelectedItem.ToString()‘”;
string strCommand = "select * from xiaoshou where "+strCond;
不报错 查询到 直接空白 请问语句上是哪里出问题了 感觉是DropDownList1.SelectedItem.ToString() 的值类型??
谢谢几位的回答 但是我试了还是筛选显示不出来,难道不是这里的问题??
后面的程序:
string strCommand = "select * from xiaoshou where "+strCond;
SqlDataAdapter myAdapter = new SqlDataAdapter(strCommand, myConnection);
DataSet mySet = new DataSet();
myAdapter.Fill(mySet, "存货名称");
GridView1.DataSourceID = null;
GridView1.DataSource = mySet.Tables["存货名称"].DefaultView;
GridView1.DataBind();
麻烦再帮我看一看
strcond的定义是: string strCond = "";
杨__羊羊
郎朗坤
相关分类