gridview列出搜索结果的问题
protected void Button1_Click(object sender, EventArgs e){
SqlConnection conn = new SqlConnection(strConn);
conn.Open();
string str = "select count(*) from chanpin where guige ='" + TextBox2.Text + "'";
SqlCommand cmd = new SqlCommand(str, conn);
SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
sda.Fill(ds);
gridview1.DataSource = ds;
gridview1.DataBind();
conn.Close();
}
以上是我的代码,但是实现的效果 却是:
Column1
0
不知道到底哪里出错了??