Public Class DataView Inherits MarshalByValueComponent Implements IBindingList, IList, ICollection,IEnumerable, _ ITypedList, ISupportInitialize |
public DataView(); public DataView(DataTable); |
DataView dv; dv = new DataView(theDataSet.Tables["Employees"]); |
DataView dv = new DataView(); dv.Table = theDataSet.Tables["Employees"]; DataView构造函数使你由DataTable中得到一个DataView对象。如果需要,反之亦可。事实上,DataTable对象的DefaultView属性返回一个该表的DataView对象。 DataView dv = dt.DefaultView; |
public virtual string RowFilter {get; set;} |
dv.RowFilter = "Country = 'USA'"; dv.RowFilter = "EmployeeID >5 AND Birthdate < #1/31/82#" dv.RowFilter = "Description LIKE '*product*'" |
dv.RowFilter = "employeeID IN (2,4,5)" |
dv.RowFilter = "Description LIKE '[[]*[]]product[[]*[]]" |
dv.RowFilter = "Description LIKE 'prod*ct" |
IIF(expression, if_true, if_false) |
IIF(employeeID<6, Len(lastname) %2 =0, Len(lastname) %2 >0) |
Dim dv As New DataView() dv = ds.Tables("Employees").DefaultView dv.RowFilter = "employeeid >5" ListBox1.Items.Clear() Dim buf As String Dim dr As DataRowView For Each dr In dv buf = "" buf &= dr("lastname").ToString()& ", " & dr("firstName").ToString() ListBox1.Items.Add(buf) Next |
CurrentRows | 包括所有未更新的、新的和修改的数据行 |
Deleted | 所有自上次调用AcceptChanges后删除的数据行 |
ModifiedCurrent | 所有自上次调用AcceptChanges后修改过的数据行 |
ModifiedOriginal | 所有自上次调用AcceptChanges后original版本的数据行 |
New | 所有自上次调用AcceptChanges后新添加的行 |
OriginalRows | 返回初始数据行,包含unchanged和deleted 的 |
Unchanged | 所有未更新的数据行 |
theMasterGrid.DataSource = m_ds.Tables("Employees").DefaultView |
m_ds.Tables("Employees").DefaultView.Sort = "lastname" theMasterGrid.DataSource = m_ds.Tables("Employees").DefaultView |
Dim dvm As DataViewManager dvm = New DataViewManager(m_ds) |
Dim dvm As DataViewManager = m_ds.DefaultViewManager |
Dim dvm As New DataViewManager() dvm.DataSet = m_ds |
Dim dvs As DataViewSetting dvs = dvm.DataViewSettings("Employees") dvs.Sort = "lastname" |
theMasterGrid.DataSource = dvm theMasterGrid.DataMember = "Employees" |
Public Interface IComponent Inherits IDisposable |
Word教程网 | Excel教程网 | Dreamweaver教程网 | Fireworks教程网 | PPT教程网 | FLASH教程网 | PS教程网 |
HTML教程网 | DIV CSS教程网 | FLASH AS教程网 | ACCESS教程网 | SQL SERVER教程网 | C语言教程网 | JAVASCRIPT教程网 |
ASP教程网 | ASP.NET教程网 | CorelDraw教程网 |