如何WHERE
为此添加条件;
sqlcmd = new SqlCommand("SELECT A.* from Experiment A INNER JOIN (SELECT ROW_NUMBER() OVER(ORDER BY AutoID ASC) AS 'RN', "+ "*FROM Experiment) B ON A.AutoID= B.AutoID AND B.RN 之间 11 和 21", con);
这是完整的代码;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
// sqlcmd = new SqlCommand("Select *From Experiment", con);
sqlcmd = new SqlCommand("SELECT A.* from Experiment A INNER JOIN (SELECT ROW_NUMBER() OVER(ORDER BY AutoID ASC) AS 'RN', "+
"*FROM Experiment) B ON A.AutoID= B.AutoID AND B.RN between 11 and 21 ", con);
adapter = new SqlDataAdapter(sqlcmd);
DataSet ds = new DataSet();
con.Open();
adapter.Fill(ds, "Experiment");
Repeater1.DataSource = ds;
Repeater1.DataBind();
}
}