datareader做为数据源绑定到Repeater中的绑定方法除了用<%# databinder.eval()%>还有哪种方法

来源:百度知道 编辑:UC知道 时间:2024/05/25 09:06:47
dataset 做为数据源可以用<@% ((DataRowView)Container.DataItem)[\"字段名\"] %>

那么datareader呢```````````

别告诉我用Binder,Binder只能绑在控件上``

你可以直接
SqlDataReader reader = myCmd.ExecuteReader();
if (reader.Read())
{
Name.InnerHtml = reader["Name"].ToString();
}
这样把数据写到控件里面,不需要什么绑定~~

你可以看一下我这个网站,没有用到dataset的..
www.iGtan.com