获取或设置用于筛选在 DataView中查看哪些行的表达式。

命名空间:System.Data
程序集:System.Data(在 system.data.dll 中)

private void MakeDataView() 
{
    DataView view = new DataView();

    view.Table = DataSet1.Tables["Suppliers"];
    view.AllowDelete = true;
    view.AllowEdit = true;
    view.AllowNew = true;
    view.RowFilter = "City = 'Berlin'";
    view.RowStateFilter = DataViewRowState.ModifiedCurrent;
    view.Sort = "CompanyName DESC";

    // Simple-bind to a TextBox control
    Text1.DataBindings.Add("Text", view, "CompanyName");
}

 posted on 2011-08-11 09:36  书山有路  阅读(220)  评论(0编辑  收藏  举报