从转发器 Vb.net 清除所有行

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19374281/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-17 15:29:09  来源:igfitidea点击:

Clear all rows from Repeater Vb.net

asp.netvb.net

提问by Harshit Tailor

How to clear all rows from Repeater.?

如何清除中继器中的所有行。?

I've tried -

我试过了 -

RptSeatOrLap.DataSource=Nothing

RptSeatOrLap.DataSource=Nothing

but not working.

但不工作。

回答by Adil

You need to call DataBind()in order to see the effect of new data source being assigned.

您需要调用DataBind()才能查看分配新数据源的效果。

RptSeatOrLap.DataSource=dtEmptyDataTable;
RptSeatOrLap.DataBind();

回答by lanshare

rpt.DataSource = null;
rpt.DataBind();

回答by AgSerna

'use dispose:

'使用处置:

rpt.Dispose 
rpt.DataBind()