gridview的数据源可以是什么?
如果先从dataSet中select数据,然后赋值给DataRow
DataRow=dataSet.Tables[ "index "].Select( "1=1 ");
然后下面绑定时报错:
gridview.DataSource = DataRow;
gridview.DataBind();
------解决方案--------------------DataView dv = new DataView(dataSet.Tables[ "index "]);
dv.RowFilter = "1 = 1 ";
gridview.DataSource = dv;
gridview.DataBind();
------解决方案--------------------我用以下的东西绑过GridView,都好使!
DataReader
DataSet
DataTable
DataView
ArrayList(里面是自定义的类)
Array(同上)
HashTable
XML