sql语句查询怎么判断查询结果为空?

sqldataadapter适合用在查询较多字段时.....

string sou = "select * from art where content like '%" + TextBox1.Text + "%'"; SqlDataAdapter da = new SqlDataAdapter(sou, conn); DataSet ds = new DataSet(); da.Fill(ds); if (ds.Tables[0].rows.count==0) { Response.Write("没有记录!"); } else { this.sou.DataSource = ds; this.sou.DataBind }

你可能感兴趣的:(sql语句查询怎么判断查询结果为空?)