代码中使用DataView对象----创建DataView对象

创建DataView对象

DataTable tbl=new DataTable("table1");

DataView dv;

dv=new DataView();

dv.Table=tbl;

dv=new DataView(tbl);

//-----------------------------------------------------------------------

DataView还有一个构造函数

DataTable tbl=new DataTable("Customers");

DataViewRowState dvrs;

dvrs=DataViewRowState.ModifiedOriginal Or DataViewRowState.Deleted;

DataView dv;

dv=new DataView();

dv.Table=tbl;

dv.RowFilter="Country= 'USA' ";

dv.Sort="City DESC";

dv.RowStateFilter=dvrs;

dv=new DataView(tbl,"Country= 'USA' ","City DESC",drvs);

posted on 2006-10-28 10:31  散步的蠕虫  阅读(318)  评论(0编辑  收藏  举报

导航