asp.net Repeater 数据绑定代码

asp.net Repeater 数据绑定代码

ASPX页面的Repeater控件:
复制代码 代码如下:


CS文件的绑定
复制代码 代码如下:

string indexTopMainStr = "select top 9 id,title from Table order by ID desc";
SqlDataAdapter rst = new SqlDataAdapter(indexTopMainStr,conn);
conn.Open();
DataSet rdt = new DataSet();
rst.Fill(rdt);
IndexTopMain.DataSource = rdt;//数据绑定
IndexTopMain.DataBind();
conn.Close();

以上就是asp.net Repeater 数据绑定代码的详细内容,更多请关注0133技术站其它相关文章!

赞(0) 打赏
未经允许不得转载:0133技术站首页 » ASP编程