当前位置: 代码迷 >> ASP.NET >> 急如何取得datagrid中的记录总数?和要写在哪个事件中
  详细解决方案

急如何取得datagrid中的记录总数?和要写在哪个事件中

热度:1058   发布时间:2013-02-25 00:00:00.0
急~~~~~~~~~~~~~~~~~~~~~~~~~~~怎么取得datagrid中的记录总数?和要写在哪个事件中?
RT

------解决方案--------------------------------------------------------
ds是你保存数据的DataSet对象,怎么会没有的呢.
DataSet ds= new DataSet;
DataTable dt=ds.Table[0];
int count = dt.Rows.Count;

------解决方案--------------------------------------------------------
探讨
ds是你保存数据的DataSet对象,怎么会没有的呢.
DataSet ds= new DataSet;
DataTable dt=ds.Table[0];
int count = dt.Rows.Count;