DataSet ds_pr = Database.ExecuteDataset(Database.ConnectionString, CommandType.StoredProcedure, "GetView", arParams); //得到一个DataSet对象 ds_pr.Tables[0].TableName = "tb";
DataView dv=ds_pr.Tables[0].DefaultView;
ds_pr.Dispose();
myGridView.DataSource =dv;
myGridView.DataBind(); 错误信息:异常详细信息: System.IndexOutOfRangeException: 无法找到表 0。请问为什么DataSet 对象ds_pr不能得到一个DataView对象,我要得到一个DataView ,然后绑定到GridView,在net 2.0里面是怎样实现的?这种方法在1.1里面都是对的。为什么在2.0中就不对了呢?
DataView dv=ds_pr.Tables[0].DefaultView;
ds_pr.Dispose();
myGridView.DataSource =dv;
myGridView.DataBind(); 错误信息:异常详细信息: System.IndexOutOfRangeException: 无法找到表 0。请问为什么DataSet 对象ds_pr不能得到一个DataView对象,我要得到一个DataView ,然后绑定到GridView,在net 2.0里面是怎样实现的?这种方法在1.1里面都是对的。为什么在2.0中就不对了呢?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货