Show / Hide Table of Contents

    IDataStore Interface

    .NET Standard 2.x | Current Version (1.0.1)

    0.5.0-alpha 1.0.1 (current)

    Namespace: PowerBuilder.Data

    Assembly: PowerBuilder.Data.dll

    The IDataStore interface represents a .NET DataStore object. .NET DataStore is a .NET version of the native PowerBuilder DataStore. It provides almost the same set of APIs as the native PowerBuilder DataStore, and allows you to use standard C# features such as LINQ, delegates and transactions.

    You can migrate existing PowerBuilder DataWindow/DataStore data objects to become .NET DataStore, and take advantages of the simple and convenient PowerScript coding styles to implement data operations at the server side.

    .NET DataStore can exchange data easily with different client types because it fully integrates with ASP.NET framework. .NET DataStore is a totally different solution from the legacy PB.NET DataStore: It is fully optimized for handling large-scale and high concurrency access requests, and can yield overall significantly better performance and scalability.

    Syntax

      public interface IDataStore : IDataStore<object>, IEnumerator<object>, IEnumerator, IDisposable, IEnumerable;
    

    Events

    Name Description
    RetrieveEnd Occurs when DataStore retrieval is completed.
    RetrieveStart Occurs when the DataStore retrieval is about to begin.
    RowDeleted Occurs when the deletion of the DataStore row is completed.
    RowDeleting Occurs when the deletion of the DataStore row is about to begin.
    UpdateEnd Occurs when committing DataStore updates to the database is completed.
    UpdateStart Occurs after the Update method is called and before changes in the DataStore are sent to the database.

    Properties

    Name Return Type Description
    Current Object Gets the reference to the row at the current position of the enumerator.
    DataObject string Specifies the name of the DataWindow object associated with the DataStore.
    DeletedCount int Gets the total number of rows that are marked for deletion in the database.
    FilteredCount int Gets the number of rows that have been filtered by the current filter criteria.
    Index int Gets the index of the current row when traversing DataStore.
    ModifiedCount int Gets the number of rows that have been modified but not updated in the DataStore.
    Object IDataObject Used to directly manipulating the object within a DataStore object from a script. These objects can be, for example, columns or text objects.
    RowCount int Gets the number of rows in the primary buffer of DataStore.
    TotalCount int Gets the total number of rows in all buffers of the DataStore.

    Methods

    Name Return Type Description
    Add(TModel item) void Appends a TModel instance as a row to the end of the primary buffer in the DataStore.
    AddRow() int Appends a row to the end of the primary buffer in the DataStore and returns the zero-based index. If any columns have default values, the row is initialized with these values.
    AddRow<TModel>(TModel model) int Appends a row to the end of the primary buffer in the DataStore and returns the zero-based index. TModel must match with the DataObject property of the DataStore.
    AddRow<TModel>(IEnumerable<TModel> list) int Appends a collection of TModel type as row(s) to the end of the primary buffer in the DataStore and returns the zero-based index of the first row added. TModel must match with the DataObject property of the DataStore.
    AsEnumerable<TModel>(DwBuffer dwBuffer = DwBuffer.Primary) IEnumerable<TModel> Converts the data in the specified buffer to an IEnumerable<TModel> object. Defaults to the primary buffer if dwBuffer is not specified.
    Avg<TModel>(Func<TModel, decimal> selector) decimal Computes the average of a sequence of System.Decimal values that are obtained by invoking a transform function on each row of the primary buffer in the DataStore.
    Avg<TModel>(Func<TModel, decimal> selector, Predicate<TModel> predicate) decimal Computes the average of a sequence of System.Decimal values that are obtained by invoking a transform function on each row of the primary buffer filtered base on a predicate in the DataStore.
    Contains(TModel item) bool Determines whether a row exists in the primary buffer of the DataStore.
    CopyTo(TModel[] array, int arrayIndex) void Copies all rows from the primary buffer of the DataStore to a compatible one-dimensional System.Array, starting at a particular System.Array index.
    Count<TModel>(Predicate<TModel> predicate) int Returns a number that represents how many rows in the primary buffer of DataStore satisfy a condition.
    DeleteRow(int row) bool Deletes the specified row by the zero-based index from the primary buffer of the DataStore. The deleted row will be moved to the delete buffer of the DataStore.
    DeleteRow<TModel>(TModel model) bool Deletes the specified row according to the specified TModel from the primary buffer of the DataStore. The deleted row will be moved to the delete buffer of the DataStore.
    DeleteRow<TModel>(Predicate<TModel> predicate) bool Deletes the row(s) based on a predicate from the primary buffer of the DataStore. The deleted row(s) will be moved to the delete buffer of the DataStore.
    Dispose<TModel>(Predicate<TModel> predicate) bool Performs application-defined tasks associated with freeing, releasing, or resetting the unmanaged resource.
    Equals(Object obj) bool Determines whether the specified object is equal to the current object. Inherited from Object.
    Evaluate<TValue>(string expression) TValue Calculates the result of the specified DataWindow expression using the data in the primary buffer of the DataStore.
    Evaluate<TValue>(string expression, int row) TValue Calculates the specified DataWindow expression by the specified row (zero-based index) in the primary buffer of the DataStore, and returns the result value.
    Exists<TModel>(Predicate<TModel> predicate) bool Determines whether there is a row in the primary buffer of the DataStore that meets the specified condition.
    ExportJson(MappingMethod mappingMethod) string Exports data from the DataStore primary buffer to a DataWindow JSON string.
    ExportJson(bool changeOnly, MappingMethod mappingMethod) string Exports all rows or only the changed rows from the DataStore to a DataWindow JSON string.
    ExportJson(DwBuffer dwbuffer, bool changedOnly, MappingMethod mappingMethod) string Exports all rows or only the changed rows from all or specified buffers to a DataWindow JSON string.
    ExportJson(bool primaryData, bool filterData, bool deleteData, bool dwcdata, MappingMethod mappingMethod) string Exports data from the specified buffer(s) and/or DataWindowChild to a DataWindow JSON string.
    ExportJson(DwBuffer dwbuffer, MappingMethod mappingMethod) string Exports data from the specified buffer to a DataWindow JSON string.
    ExportJson(DwBuffer dwbuffer, int startRow, MappingMethod mappingMethod) string Exports the rows (from the specified starting position to the end) from the specified buffer to a DataWindow JSON string.
    ExportJson(DwBuffer dwbuffer, int startRow, int endRow, MappingMethod mappingMethod) string Exports the rows (from the specified starting position to the ending position) from the specified buffer to a DataWindow JSON string.
    ExportJson(DwBuffer dwbuffer, int startRow, int endRow, short startColumn, MappingMethod mappingMethod) string Exports the rows (from the specified starting position to the ending position) and the columns (from the specified starting position to the end) from the specified buffer to a DataWindow JSON string.
    ExportJson(DwBuffer dwbuffer, int startRow, int endRow, short startColumn, short endColumn, MappingMethod mappingMethod) string Exports the rows (from the specified starting position to the ending position) and the columns (from the specified starting position to the ending position) from the specified buffer to a DataWindow JSON string.
    ExportPlainJson() string Exports data from the DataStore primary buffer to a plain-format JSON string.
    ExportPlainJson(bool changeOnly) string Exports all rows or only the changed rows from the DataStore to a plain-format JSON string.
    ExportPlainJson(DwBuffer dwbuffer, bool changedOnly) string Exports all rows or only the changed rows from all or specified buffers to a plain-format or DataWindow JSON string.
    ExportPlainJson(bool primaryData, bool filterData, bool deleteData, bool dwcdata) string Exports data from the specified buffer(s) and/or DataWindowChild to a plain-format JSON string.
    ExportPlainJson(DwBuffer dwbuffer) string Exports data from the specified buffer to a plain-format JSON string.
    ExportPlainJson(DwBuffer dwbuffer, int startRow) string Exports the rows (from the specified starting position to the end) from the specified buffer to a plain-format JSON string.
    ExportPlainJson(DwBuffer dwbuffer, int startRow, int endRow) string Exports the rows (from the specified starting position to the ending position) from the specified buffer to a plain-format JSON string.
    ExportPlainJson(DwBuffer dwbuffer, int startRow, int endRow, short startColumn) string Exports the rows (from the specified starting position to the ending position) and the columns (from the specified starting position to the end) from the specified buffer to a plain-format JSON string.
    ExportPlainJson(DwBuffer dwbuffer, int startRow, int endRow, short startColumn, short endColumn) string Exports the rows (from the specified starting position to the ending position) and the columns (from the specified starting position to the ending position) from the specified buffer to a plain-format JSON string.
    ExportString(bool colheading = true) string Exports all of the data rows from the primary buffer of the DataStore to a string. The column name is exported by default.
    ExportString(int startRow, int endRow, bool colheading = true) string Exports the rows (from the specified starting position to the ending position) from the primary buffer of the DataStore to a string. The column name is exported by default.
    ExportString(int startRow, int endRow, short startColumn, short endColumn, bool colheading = true) string Exports the rows (from the specified starting position to the ending position) and the columns (from the specified starting position to the ending position) from the primary buffer of the DataStore to a string. The column name is exported by default.
    Filter(string format = null) void Filters rows by the current filter criteria. Rows that do not meet the filter criteria are moved to the filter buffer. The filter criteria can be re-set using the format parameter.
    Filter<TModel>(Predicate<TModel> predicate) bool Filters rows by the filter criteria specified by Predicate<TModel>. Rows that do not meet the filter criteria are moved to the filter buffer.
    FilterEx<TModel>(Expression<Predicate<TModel>> expression) bool Generic method. Filters rows by the filter criteria specified by Expression<Predicate<TModel>>. Rows that do not meet the filter criteria are moved to the filter buffer.
    FilterEx(Expression<Predicate<TModel>> expression) bool Filters rows by the filter criteria specified by Expression<Predicate<TModel>>. Rows that do not meet the filter criteria are moved to the filter buffer. (Inherited from IDataStore<TModel>)
    Find<TModel>(string expression, int start = -1, int end = -1) <TModel> Generic method. Finds the next zero-based row in the specified buffer of the DataStore in which data meets the condition specified by the expression.
    Find<TModel>(Predicate<TModel> predicate, int start = -1, int end = -1) <TModel> Generic method. Finds the next row in the DataStore in which data meets the criteria defined by Predicate.
    Find<TModel>(string expression, DwBuffer dwBuffer = DwBuffer.Primary) <TModel> Generic method. Finds the next zero-based row in the specified buffer of the DataStore in which data meets the condition specified by the expression.
    Find<TModel>(Predicate<TModel> predicate, dwBuffer = DwBuffer.Primary) <TModel> Generic method. Finds the next row in the DataStore in which data meets the criteria defined by Predicate.
    FindIndex(string expression, int start = -1, int end = -1) int Returns the zero-based index of the next row in the specified buffer of the DataStore in which data meets the condition specified by the expression.
    FindIndex<TModel>(Predicate<TModel> predicate, int start = -1, int end = -1) int Generic method. Returns the index of the next row in the DataStore in which data meets the criteria defined by Predicate.
    FindIndex(string expression, int start, int end, DwBuffer dwBuffer = DwBuffer.Primary) int Returns the zero-based index of the next row in the specified buffer of the DataStore in which data meets the condition specified by the expression.
    FindIndex<TModel>(Predicate<TModel> predicate, DwBuffer dwBuffer = DwBuffer.Primary) int Generic method. Returns the index of the next row in the DataStore in which data meets the criteria defined by Predicate.
    FirstOrDefault<TModel>() TModel Generic method. Returns the first data row of the DataStore. If no data row is found, returns null.
    FirstOrDefault<TModel>(Predicate<TModel> predicate) TModel Generic method. Returns the first data row of the DataStore that meets the criteria specified by Predicate<TModel>. If no data row is found, returns null.
    GetChild(string name) IDataStore Provides a reference to the child DataWindow, which you can use to manipulate that DataStore.
    GetEnumerator() IEnumerator Obtains the enumerator that can be used to iterate through the DataStore. Inherited from IEnumerator<T>.
    GetItem<TValue>(int row, short column, DwBuffer bufferType = DwBuffer.Primary, bool isOriginalValue = false) TValue Generic method. Gets the data for the specified row and column from the specified buffer of the DataStore.
    GetItem<TValue>(int row, string column, DwBuffer bufferType = DwBuffer.Primary, bool isOriginalValue = false) TValue Generic method. Gets the data for the specified row and column from the specified buffer of the DataStore.
    GetItem(int row, short column, DwBuffer bufferType = DwBuffer.Primary, bool isOriginalValue = false) object Gets the data for the specified row and column from the specified buffer of the DataStore.
    GetItem(int row, string column, DwBuffer bufferType = DwBuffer.Primary, bool isOriginalValue = false) object Gets the data for the specified row and column from the specified buffer of the DataStore.
    GetItemBoolean(int row, short column, DwBuffer bufferType = DwBuffer.Primary, bool isOriginalValue = false) bool? Gets data whose type is Boolean for the specified row and column (specified by column number) from the specified buffer of the DataStore.
    GetItemBoolean(int row, string column, DwBuffer bufferType = DwBuffer.Primary, bool isOriginalValue = false) bool? Gets data whose type is Boolean for the specified row and column (specified by column name) from the specified buffer of the DataStore.
    GetItemDate(int row, short column, DwBuffer bufferType = DwBuffer.Primary, bool isOriginalValue = false) DateTime? Gets data whose type is DateTime for the specified row and column from the specified buffer of the DataStore.
    GetItemDate(int row, string column, DwBuffer bufferType = DwBuffer.Primary, bool isOriginalValue = false) DateTime? Gets data whose type is DateTime for the specified row and column from the specified buffer of the DataStore.
    GetItemDateTime(int row, short column, DwBuffer bufferType = DwBuffer.Primary, bool isOriginalValue = false) DateTime? Gets data whose type is DateTime for the specified row and column from the specified buffer of the DataStore.
    GetItemDateTime(int row, string column, DwBuffer bufferType = DwBuffer.Primary, bool isOriginalValue = false) DateTime? Gets data whose type is DateTime for the specified row and column from the specified buffer of the DataStore.
    GetItemDecimal(int row, short column, DwBuffer bufferType = DwBuffer.Primary, bool isOriginalValue = false) decimal? Gets data whose type is Decimal for the specified row and column from the specified buffer of the DataStore.
    GetItemDecimal(int row, string column, DwBuffer bufferType = DwBuffer.Primary, bool isOriginalValue = false) decimal? Gets data whose type is Decimal for the specified row and column from the specified buffer of the DataStore.
    GetItemNumber(int row, short column, DwBuffer bufferType = DwBuffer.Primary, bool isOriginalValue = false) double? Gets data whose type is Double for the specified row and column from the specified buffer of the DataStore.
    GetItemNumber(int row, string column, DwBuffer bufferType = DwBuffer.Primary, bool isOriginalValue = false) double? Gets data whose type is Double for the specified row and column from the specified buffer of the DataStore.
    GetItemStatus(int row, short column, DwBuffer dwbuffer = DwBuffer.Primary) PropertyState Reports the modification status of a column (specified by column number) within a row in the specified buffer.
    GetItemStatus(int row, string column, DwBuffer dwbuffer = DwBuffer.Primary) PropertyState Gets the modification status of a column (specified by column name) within a row in the specified buffer.
    GetItemStatus<TModel>(int row, Expression<Func<TModel, object>> selector, DwBuffer dwbuffer = DwBuffer.Primary) PropertyState Gets the modification status of a column (specified by an expression) within a row in the specified buffer.
    GetItemString(int row, short column, DwBuffer bufferType = DwBuffer.Primary, bool isOriginalValue = false) string Gets data whose type is String for the specified row and column from the specified buffer of the DataStore.
    GetItemString(int row, string column, DwBuffer bufferType = DwBuffer.Primary, bool isOriginalValue = false) string Gets data whose type is String for the specified row and column from the specified buffer of the DataStore.
    GetItemTime(int row, short column, DwBuffer bufferType = DwBuffer.Primary, bool isOriginalValue = false) TimeSpan? Gets data whose type is TimeSpan for the specified row and column from the specified buffer of the DataStore.
    GetItemTime(int row, string column, DwBuffer bufferType = DwBuffer.Primary, bool isOriginalValue = false) TimeSpan? Gets data whose type is TimeSpan for the specified row and column from the specified buffer of the DataStore.
    GetModel<TModel>(int row) TModel Obtains the data of the specified row.
    GetModelByRowId<TModel>(int rowid) <TModel> Gets the TModel instance of a row according to the specified unique row identifier associated with that row.
    GetRowFromRowId(int rowid, DwBuffer dwBuffer = DwBuffer.Primary) int Gets the row number of a row in the DataStore from the unique row identifier associated with that row.
    GetRowIdFromRow(int rownumber, DwBuffer dwBuffer = DwBuffer.Primary) int Gets the unique row identifier of a row in the DataStore from the row number associated with that row.
    GetRowStatus(int row, DwBuffer dwbuffer = DwBuffer.Primary) ModelState Gets the modification status of a row.
    GetSqlSelect() string Gets the SQL SELECT statement associated with the DataStore.
    GetValues(short column, DwBuffer bufferType = DwBuffer.Primary) IEnumerable<object> Obtains a collection of values of the specified column (by zero-based column number), from the specified buffer in the DataStore.
    GetValues(string column, DwBuffer bufferType = DwBuffer.Primary) IEnumerable<object> Obtains a collection of values of the specified column (by column name), from the specified buffer in the DataStore.
    GroupBy() IEnumerable<IGrouping<object, IGroupingGetter>> Groups all rows of the primary buffer by the current grouping criteria of DataStore.
    GroupBy<TModel>() IEnumerable<IGrouping<object, IGroupingGetter<TModel>>> Generic method. Groups all rows of the primary buffer by the current grouping criteria of DataStore.
    GroupBy(int level, string sortKey = null) IEnumerable<IGrouping<object, IModelGetter>> Groups rows of the primary buffer by the specified zero-based level of grouping criteria of DataStore.
    GroupBy<TModel>(int level, string sortKey = null) IEnumerable<IGrouping<object, TModel>> Generic method. Groups rows of the primary buffer by the specified zero-based level of grouping criteria of DataStore.
    GroupBy(string selectorKey, string sortKey = null) IEnumerable<IGrouping<object, IModelGetter>> Groups rows of the primary buffer by the custom grouping criteria.
    GroupBy<TModel>(string selectorKey, string sortKey = null) IEnumerable<IGrouping<object, TModel>> Generic method. Groups rows of the primary buffer by the custom grouping criteria.
    GroupBy<TModel>(Func<TModel, object> selectorKey) IEnumerable<IGrouping<object, TModel>> Generic method. Groups rows of the primary buffer by the custom grouping criteria defined by Func<TModel, object>.
    ImportEntry(IModelEntry modelEntry) int Imports an IModelEntry object, which contains data and state, to the end of the DataStore.
    ImportEntry(IEnumerable modelEntries) int Imports a sequence of IModelEntry objects, which contain data and state, to the end of the DataStore.
    ImportJson(string Json) int Inserts data from a JSON string into the DataStore.
    ImportJson(string Json, DwBuffer dwbuffer) int Inserts data from a JSON string into the specified buffer of DataStore.
    ImportJson(string Json, DwBuffer dwbuffer, int startRow) int Inserts data from a JSON string into the specified buffer of DataStore. You can specify the starting position in the JSON array.
    ImportJson(string Json, DwBuffer dwbuffer, int startRow, int endRow) int Inserts data from a JSON string into the specified buffer of DataStore. You can specify the starting and ending position in the JSON array.
    ImportJson(string Json, DwBuffer dwbuffer, int startRow, int endRow, int startColumn) int Inserts data from a JSON string into the specified buffer of DataStore. You can specify the starting and ending positions in the JSON array, and you can specify the number of the first key value in the JSON object to be imported.
    ImportJson(string Json, DwBuffer dwbuffer, int startRow, int endRow, int startColumn, int endColumn) int Inserts data from a JSON string into the specified buffer of DataStore. You can specify the starting and ending positions in the JSON array, and you can specify the number of the first key value and the number of the last key value in the JSON object to be imported.
    ImportJson(string Json, DwBuffer dwbuffer, int startRow, int endRow, int startColumn, int endColumn, int dwStartColumn) int Inserts data from a JSON string into the specified buffer of DataStore. You can specify the starting and ending positions in the JSON array, and specify the number of the first key value and the number of the last key value in the JSON object to be imported. You can also specify the number of the first column in the DataStore that should receive data.
    ImportJsonByKey(string Json) int Inserts data from a JSON string into the DataStore according to the key name of the JSON item.
    ImportJsonByKey(string Json, DwBuffer dwbuffer) int Inserts data from a JSON string into the specified buffer of DataStore according to the key name of the JSON item.
    ImportJsonByKey(string Json, DwBuffer dwbuffer, int startRow) int Inserts data from a JSON string into the specified buffer of DataStore according to the key name of the JSON item. You can specify the starting position in the JSON array.
    mportJsonByKey(string Json, DwBuffer dwbuffer, int startRow, int endRow) int Inserts data from a JSON string into the specified buffer of DataStore according to the key name of the JSON item. You can specify the starting and ending positions in the JSON array.
    ImportString(string value) int Inserts the tab-separated data from a string into the DataStore.
    ImportString(string value, int startRow, int endRow = -1) int Inserts the tab-separated data from a string into the DataStore. You can specify the starting and ending rows in the string.
    ImportString(string value, int startRow, int endRow, short startColumn, short endColumn) int Inserts the tab-separated data from a string into the DataStore. You can specify the starting and ending rows in the string, and specify the number of the first column and the number of the last column in the string to be imported.
    ImportString(string value, int startRow, int endRow, short startColumn, short endColumn, short dwStartColumn) int Inserts the tab-separated data from a string into the DataStore. You can specify the starting and ending rows in the string, and specify the number of the first column and the number of the last column in the string to be imported. You can also specify the number of the first column in the DataStore that should receive data.
    IndexOf(TModel item) int Determines the index of a specific model instance in the primary buffer of DataStore.
    Insert(int index, TModel item) void Inserts data at the specified index in the primary buffer of the DataStore.
    InsertRow(int row) int Inserts a row to the specified position in the DataStore. If any columns have default values, the row is initialized with these values.
    InsertRow<TModel>(int row, TModel model) int Inserts a TModel instance as a row to the specified position in the primary buffer of the DataStore.
    LastOrDefault<TModel>() TModel Generic method. Returns the last data row of the DataStore. If no data row is found, returns null.
    LastOrDefault<TModel>(Predicate<TModel> predicate) TModel Generic method. Returns the last data row of the DataStore that meets the criteria specified by Predicate<TModel>. If no data row is found, returns null.
    Max<TModel, TResult>(Func<TModel, TResult> selector) TResult Invokes a transform function on each row of the primary buffer in the DataStore and returns the maximum result value.
    Max<Tmodel, TResult>(Func<Tmodel, TResult> selector, Predicate<Tmodel> predicate) TResult Invokes a transform function on each row (that satisfies the condition specified by Predicate<TModel>) in the primary buffer of the DataStore and returns the maximum result value.
    Min<TModel, TResult>(Func<TModel, TResult> selector) TResult Invokes a transform function on each row of the primary buffer in the DataStore and returns the minimum result value.
    Min<TModel, TResult>(Func<TModel, TResult> selector, Predicate<TModel> predicate) TResult Invokes a transform function on each row (that satisfies the condition specified by Predicate<TModel>) in the primary buffer of the DataStore and returns the minimum result value.
    MoveNext() bool Advances the enumerator to the next row of the primary buffer in DataStore.
    OnInitialized() void Executes this method when instantiating the DataStore.
    OnRetrieveEnd(object sender, DwRetrieveEventArgs e) void This method is called when the DataStore completes the data retrieval. It triggers the RetrieveEnd event by default, and it can be overridden in a child class of the DataStore.
    OnRetrieveStart(object sender, DwRetrieveEventArgs e) void This method is called before the DataStore starts the data retrieval. It triggers the RetrieveStart event by default, and it can be overridden in a child class of the DataStore.
    OnRowDeleted(object sender, DwRowChangeEventArgs e) void This method is called after a row in the DataStore has been deleted. It triggers the RowDeleted event by default, and it can be overridden in a child class of the DataStore.
    OnRowDeleting(object sender, DwRowChangeEventArgs e) void This method is called before a row in the DataStore is about to be deleted. It triggers the RowDeleting event by default, and it can be overridden in a child class of the DataStore.
    OnUpdateEnd(object sender, DwUpdateEventArgs e) void This method is called after DataStore has finished updating the data. It triggers the UpdateEnd event by default, and it can be overridden in a child class of the DataStore.
    OnUpdateStart(object sender, DwUpdateEventArgs e) void This method is called before the DataStore updates the data. It triggers the UpdateStart event by default, and it can be overridden in a child class of the DataStore.
    OrderBy<TModel>(Func<TModel, object> keySelector) IOrderable<TModel> Sorts the rows of the primary buffer in the DataStore in ascending order according to a key.
    OrderByDescending<TModel>(Func<TModel, object> keySelector) IOrderable<TModel> Sorts the rows of the primary buffer in the DataStore in descending order according to a key.
    Remove(TModel item) bool Removes the specified row from the primary buffer of the DataStore.
    RemoveAt(int index) void Removes the row according to the specified index from the primary buffer of the DataStore. The index is the same as the zero-base row number.
    ReselectRow(int row) int Accesses the database to retrieve values for all columns that can be updated and refreshes all timestamp columns in a row in the DataStore.
    Reset() void Clears all the data from the DataStore.
    ResetUpdate() bool Clears the update flags in the primary and filter buffers and empties the delete buffer of the DataStore.
    Retrieve(params object[] arguments) int Retrieves rows from the database. If arguments are included, the argument values are used for the retrieval arguments in the SQL SELECT statement for the DataStore.
    RowsCopy(int startrow, int endrow, DwBuffer copybuffer, IDataStore targetdw, int beforerow, DwBuffer targetbuffer) bool Copies a range of rows from one DataStore to another, or from one buffer to another within a single DataStore.
    RowsDiscard(int startrow, int endrow, DwBuffer buffer) bool Discards a range of rows in the DataStore. Once a row has been discarded using RowsDiscard, you cannot restore the row unless you retrieve it again from the database.
    RowsMove(int startrow, int endrow, DwBuffer movebuffer, IDataStore targetdw, int beforerow, DwBuffer targetbuffer) bool Clears a range of rows from one DataStore and inserts them in another. Alternatively, RowsMove can move rows from one buffer to another within a single DataStore.
    SetDataContext(DataContext context) bool Sets the data context.
    SetFilter(string format) bool Specifies the filter criteria for the DataStore.
    SetItem(int row, short column, object value) bool Sets the value of a row and column (by column name) in the DataStore to the specified value.
    SetItem(int row, string column, object value) bool Sets the value of a row and column (by column number) in the DataStore to the specified value.
    SetItemStatus(int row, short column, DwBuffer dwbuffer, PropertyState status) bool Sets the modification status in the column (by column number) for a row in the specified buffer of the DataStore.
    SetItemStatus(int row, string column, DwBuffer dwbuffer, PropertyState status) bool Sets the modification status in the column (by column name) for a row in the specified buffer in the DataStore.
    SetModel<TModel>(int row, TModel model) void Sets the data for the specified row.
    SetSort(string format) bool Specifies the sort criteria for the DataStore.
    SetSqlSelect(string statement, bool isValidation = true) bool Specifies the SQL SELECT statement for the DataStore.
    SetValidate(short column, string rule) bool Sets the validation rule for a column (specified by column number) in the DataStore.
    SetValidate(string column, string rule) bool Sets the validation rule for a column (specified by column name) in the DataStore.
    Sort(string format = null) bool Sorts the rows in the DataStore using the current sort criteria.
    Sum<TModel>(Func<TModel, decimal> selector) decimal Computes the sum of a sequence of decimal values that are obtained by invoking a transform function on each row of the primary buffer in DataStore.
    Sum<TModel>(Func<TModel, decimal> selector, Predicate<TModel> predicate) decimal Computes the sum of a sequence of System.Decimal values that are obtained by invoking a transform function on each row (filtered by a predicate) of the primary buffer in DataStore.
    ToString() string Returns a string that represents the current object.
    Update(bool resetflag = true) int Updates the database with the changes made in the DataStore.
    Validate() bool Verifies the data using the data validation rules set in the DataStore.
    Validate(out List<ValidationResult> ValidationResults) bool Verifies the data using the data validation rules set in the DataStore, and outputs the verification results.

    Remarks

    .NET DataStore is used in almost exactly the same way as the PowerBuilder DataStore; and on top of that, .NET DataStore also supports to use the advanced .NET development methods, such as LINQ set operations. .NET DataStore is very useful when you want to access the database and manipulate the data.

    You can use .NET DataStore to do the following:
    1. Access the data in the database.
    2. Append, delete, modify or query the data and commit the change to the database conveniently.
    3. Group or sort the data.
    4. Manage the database transactions automatically or manually.
    5. Check the data validity and integrity.
    6. Track the data modification.
    7. Used as the replacement for the migrated PowerBuilder DataStore.

    When .NET DataStore is created, it must be associated with a DataWindow object.

    It uses the Retrieve method to obtain the data and place the data to the primary buffer. Parameters defined in the DataStore can also be passed in to retrieve data.

    AddRow method can be used to append data to the DataStore.

    DeleteRow method can be used to remove data from the DataStore, however, data is not directly deleted from the DataStore, it is only moved to the delete buffer where you can still manipulate it later.

    SetSort method can be used to set the sorting criteria and Sort method to sort the data according to the predefined criteria.

    SetFilter method can be used to filter the data, and the data will be moved to the filter buffer.

    Update method can be used to finally commit the change to the database.

    DataStore also provides many events that will occur on data change; these events include RowDeleting, RowDeleted, RetrieveStart, RetrieveEnd, UpdateStart, and UpdateEnd.

    Back to top Generated by Appeon