Show / Hide Table of Contents

    IDataStoreBase Interface

    .NET Standard 2.x

    Namespace: DWNet.Data

    Assembly: DWNet.Data.dll

    Provides the public interface for DataStores and generic DataStores. However, you are recommended to use the interface of IDataStore and IDataStore<TModel> rather than this.

    Syntax

    public interface IDataStoreBase : IEnumerable, IMapperTrackable, IDisposable
    

    Properties

    Name Return Type Description
    DataContext DataContext Gets or sets the entry to the database associated with DataStore.
    DeletedCount int Gets the total number of rows that are marked for deletion in the database.
    DwMeta IDwMeta Gets the meta data in the DataStore model.
    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.
    RowCount int Gets the total number of rows in the primary buffer of the DataStore.
    TotalCount int Gets the total number of rows in all buffers of the DataStore.

    Methods

    Name Return Type Description
    Filter() bool Filters rows by the current filter criteria. Rows that do not meet the filter criteria are moved to the filter buffer.
    GetChild(string name) IDataStoreBase Provides a reference to the child DataWindow, which you can use to manipulate that DataStore.
    GetDataImport(DataFormat dataFromat) IDwDataImporter Gets the DataStore importer, you need to specify the data import format(DataFormat).
    GetDataExporter(DataFormat dataFromat) IDwDataExporter Gets the DataStore exporter, you need to specify the data export format(DataFormat).
    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.
    GetItems<TValue>(short column, DwBuffer bufferType = DwBuffer.Primary) IEnumerable<TValue> Gets the data of the specified column index.
    GetItems<TValue>(string column, DwBuffer bufferType = DwBuffer.Primary) IEnumerable<TValue> Gets the data of the specified column name.
    GetItemStatus(int row, short column, DwBuffer bufferType = DwBuffer.Primary) PropertyState Gets the modification status of a column (specified by column number) within a row in the specified buffer.
    GetItemStatus(int row, string column, DwBuffer bufferType = DwBuffer.Primary) PropertyState Gets the modification status of a column (specified by column name) within a row in the specified buffer.
    GetRowStatus(int row, DwBuffer bufferType = DwBuffer.Primary) ModelState Gets the modification status of a 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.
    GetSqlSelect() string Gets the SQL SELECT statement associated with the DataStore.
    GetTemplate() IDataTemplate Gets the default XML format template for DataStore data export.
    GetTemplate(string templateName) IDataTemplate Specifies the name and format to get the template for DataStore data export.
    ImportEntry(IModelEntry modelEntry) int Imports an IModelEntry object, which contains data and state, to the end of the DataStore.
    ImportEntry(IEnumerable<IModelEntry> modelEntries) int Imports a sequence of IModelEntry objects, which contain data and state, to the end of the DataStore.
    MoveNext() bool Advances the enumerator to the next row of the primary buffer in 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.
    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() bool 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.
    RetrieveByKey(params object[] parameters) int Retrieves rows from the database. You can specify a value for a property with the [Key] attribute to retrieve parameters in a SQL SELECT statement in the DataStore.
    RetrieveByPage(int currentIndex, int pageSize, params object[] arguments) int Retrieves the specified number of rows in the database starting at the specified row position. If a parameter is included, the parameter value is used to retrieve the parameter in the SQL SELECT statement of 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.
    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.
    SetSqlSelect(string statement, bool isValidation = true) bool Specifies the SQL SELECT statement for the DataStore.
    Update(bool resetflag = true) int Updates the database with the changes made in the DataStore.
    Update(UpdateSqlStrategy updateSqlStrategy, 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.

    Extension Methods

    Name Return Type Description
    ExportJson(this IDataStoreBase dataStore, MappingMethod mappingMethod) string Exports data from the DataStore primary buffer to a DataWindow JSON string.
    ExportJson(this IDataStoreBase dataStore, bool changedOnly, MappingMethod mappingMethod) string Exports all rows or only the changed rows from the DataStore to a DataWindow JSON string.
    ExportJson(this IDataStoreBase dataStore, 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(this IDataStoreBase dataStore, 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(this IDataStoreBase dataStore, DwBuffer dwbuffer, MappingMethod mappingMethod) string Exports data from the specified buffer to a DataWindow JSON string.
    ExportJson(this IDataStoreBase dataStore, 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(this IDataStoreBase dataStore, 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(this IDataStoreBase dataStore, DwBuffer dwbuffer, int startRow, int endRow, int 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(this IDataStoreBase dataStore, DwBuffer dwbuffer, int startRow, int endRow, int startColumn, int 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(this IDataStoreBase dataStore) string Exports data from the DataStore primary buffer to a plain-format JSON string.
    ExportPlainJson(this IDataStoreBase dataStore, bool changedOnly) string Exports all rows or only the changed rows from the DataStore to a plain-format JSON string.
    ExportPlainJson(this IDataStoreBase dataStore, 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(this IDataStoreBase dataStore, 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(this IDataStoreBase dataStore, DwBuffer dwbuffer) string Exports data from the specified buffer to a plain-format JSON string.
    ExportPlainJson(this IDataStoreBase dataStore, 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(this IDataStoreBase dataStore, 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(this IDataStoreBase dataStore, DwBuffer dwbuffer, int startRow, int endRow, int 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(this IDataStoreBase dataStore, DwBuffer dwbuffer, int startRow, int endRow, int startColumn, int 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.
    ExportPlainXml(this IDataStoreBase dataStore) string Exports data from the DataStore primary buffer to a plain-format Xml string.
    ExportPlainXml(this IDataStoreBase dataStore, bool changedOnly) string Exports all rows or only the changed rows from the DataStore to a plain-format Xml string.
    ExportPlainXml(this IDataStoreBase dataStore, DwBuffer dwbuffer, bool changedOnly) string Exports all rows or only the changed rows from all or specified buffers to a plain-format or DataWindow Xml string.
    ExportPlainXml(this IDataStoreBase dataStore, bool primaryData, bool filterData, bool deleteData, bool dwcdata) string Exports data from the specified buffer(s) and/or DataWindowChild to a plain-format Xml string.
    ExportPlainXml(this IDataStoreBase dataStore, DwBuffer dwbuffer) string Exports data from the specified buffer to a plain-format Xml string.
    ExportPlainXml(this IDataStoreBase dataStore, DwBuffer dwbuffer, int startRow) string Exports the rows (from the specified starting position to the end) from the specified buffer to a plain-format Xml string.
    ExportPlainXml(this IDataStoreBase dataStore, 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 Xml string.
    ExportPlainXml(this IDataStoreBase dataStore, DwBuffer dwbuffer, int startRow, int endRow, int 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 Xml string.
    ExportPlainXml(this IDataStoreBase dataStore, DwBuffer dwbuffer, int startRow, int endRow, int startColumn, int 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 Xml string.
    ExportRowAsJson(this IDataStoreBase dataStore, int row, DwBuffer dwBuffer = DwBuffer.Primary) string Exports a data row from the specified buffer of a DataStore object to the JSON string.
    ExportRowAsString(this IDataStoreBase dataStore, int row, DwBuffer dwBuffer = DwBuffer.Primary) string Exports a data row from the specified buffer of a DataStore object to the TXT string.
    ExportRowAsXml(this IDataStoreBase dataStore, int row, DwBuffer dwBuffer = DwBuffer.Primary) string Exports a data row from the specified buffer of a DataStore object to the XML string.
    ExportString(this IDataStoreBase dataStore, 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.
    ExportXml(this IDataStoreBase dataStore, MappingMethod mappingMethod) string Exports data from the DataStore primary buffer to a DataWindow Xml string.
    ExportXml(this IDataStoreBase dataStore, bool changedOnly, MappingMethod mappingMethod) string Exports all rows or only the changed rows from the DataStore to a DataWindow Xml string.
    ExportXml(this IDataStoreBase dataStore, DwBuffer dwbuffer, bool changedOnly, MappingMethod mappingMethod) string Exports all rows or only the changed rows from all or specified buffers to a DataWindow Xml string.
    ExportXml(this IDataStoreBase dataStore, bool primaryData, bool filterData, bool deleteData, bool dwcdata, MappingMethod mappingMethod) string Exports data from the specified buffer(s) and/or DataWindowChild to a DataWindow Xml string.
    ExportXml(this IDataStoreBase dataStore, DwBuffer dwbuffer, MappingMethod mappingMethod) string Exports data from the specified buffer to a DataWindow Xml string.
    ExportXml(this IDataStoreBase dataStore, 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 Xml string.
    ExportXml(this IDataStoreBase dataStore, 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 Xml string.
    ExportXml(this IDataStoreBase dataStore, DwBuffer dwbuffer, int startRow, int endRow, int 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 Xml string.
    ExportXml(this IDataStoreBase dataStore, DwBuffer dwbuffer, int startRow, int endRow, int startColumn, int 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 Xml string.
    ExportString(this IDataStoreBase dataStore, 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(this IDataStoreBase dataStore, int startRow, int endRow, int startColumn, int 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.
    ImportJson(this IDataStoreBase dataStore, string text) int Inserts data from a JSON string into the DataStore.
    ImportJson(this IDataStoreBase dataStore, string text, DwBuffer dwbuffer) int Inserts data from a JSON string into the specified buffer of DataStore.
    ImportJson(this IDataStoreBase dataStore, string text, 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(this IDataStoreBase dataStore, string text, 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(this IDataStoreBase dataStore, string text, 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(this IDataStoreBase dataStore, string text, 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(this IDataStoreBase dataStore, string text, 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(this IDataStoreBase dataStore, string text) int Inserts data from a JSON string into the DataStore according to the key name of the JSON item.
    ImportJsonByKey(this IDataStoreBase dataStore, string text, 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(this IDataStoreBase dataStore, string text, 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.
    ImportJsonByKey(this IDataStoreBase dataStore, string text, 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.
    ImportRowFromJson(this IDataStoreBase dataStore, string text, int row, DwBuffer dwBuffer = DwBuffer.Primary) int Inserts a data row from a JSON string into a DataStore object.
    ImportRowFromString(this IDataStoreBase dataStore, string text, int row, DwBuffer dwBuffer = DwBuffer.Primary) int Inserts a data row from a TXT string into a DataStore object.
    ImportRowFromXml(this IDataStoreBase dataStore, string text, int row, DwBuffer dwBuffer = DwBuffer.Primary) int Inserts a data row from a XML string into a DataStore object.
    ImportString(this IDataStoreBase dataStore, string text) int Inserts the tab-separated data from a string into the DataStore.
    ImportString(this IDataStoreBase dataStore, string text, int startRow) int Inserts the tab-separated data from a string into the DataStore. You can specify the starting row in the string.
    ImportString(this IDataStoreBase dataStore, string text, int startRow, int endRow) int Inserts the tab-separated data from a string into the DataStore. You can specify the starting and ending rows in the string.
    ImportString(this IDataStoreBase dataStore, string text, int startRow, int endRow, int startColumn) 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 in the string to be imported.
    ImportString(this IDataStoreBase dataStore, string text, int startRow, int endRow, int startColumn, int 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(this IDataStoreBase dataStore, string text, int startRow, int endRow, int startColumn, int endColumn, int 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.
    ImportXml(this IDataStoreBase dataStore, string text) int Inserts data from a Xml string into the DataStore.
    ImportXml(this IDataStoreBase dataStore, string text, DwBuffer dwbuffer) int Inserts data from a Xml string into the specified buffer of DataStore.
    ImportXml(this IDataStoreBase dataStore, string text, DwBuffer dwbuffer, int startRow) int Inserts data from a Xml string into the specified buffer of DataStore. You can specify the starting position in the Xml array.
    ImportXml(this IDataStoreBase dataStore, string text, DwBuffer dwbuffer, int startRow, int endRow) int Inserts data from a Xml string into the specified buffer of DataStore. You can specify the starting and ending position in the Xml array.
    ImportXml(this IDataStoreBase dataStore, string text, DwBuffer dwbuffer, int startRow, int endRow, int startColumn) int Inserts data from a Xml string into the specified buffer of DataStore. You can specify the starting and ending positions in the Xml array, and you can specify the number of the first key value in the Xml object to be imported.
    ImportXml(this IDataStoreBase dataStore, string text, DwBuffer dwbuffer, int startRow, int endRow, int startColumn, int endColumn) int Inserts data from a Xml string into the specified buffer of DataStore. You can specify the starting and ending positions in the Xml array, and you can specify the number of the first key value and the number of the last key value in the Xml object to be imported.
    ImportXml(this IDataStoreBase dataStore, string text, DwBuffer dwbuffer, int startRow, int endRow, int startColumn, int endColumn, int dwStartColumn) int Inserts data from a Xml string into the specified buffer of DataStore. You can specify the starting and ending positions in the Xml array, and specify the number of the first key value and the number of the last key value in the Xml object to be imported. You can also specify the number of the first column in the DataStore that should receive data.
    ImportXmlByKey(this IDataStoreBase dataStore, string text) int Inserts data from a Xml string into the DataStore according to the key name of the Xml item.
    ImportXmlByKey(this IDataStoreBase dataStore, string text, DwBuffer dwbuffer) int Inserts data from a Xml string into the specified buffer of DataStore according to the key name of the Xml item.
    ImportXmlByKey(this IDataStoreBase dataStore, string text, DwBuffer dwbuffer, int startRow) int Inserts data from a Xml string into the specified buffer of DataStore according to the key name of the Xml item. You can specify the starting position in the Xml array.
    ImportXmlByKey(this IDataStoreBase dataStore, string text, DwBuffer dwbuffer, int startRow, int endRow) int Inserts data from a Xml string into the specified buffer of DataStore according to the key name of the Xml item. You can specify the starting and ending positions in the Xml array.

    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.

    ​

    Back to top Generated by Appeon