Click here to Skip to main content
15,892,674 members
Articles / Programming Languages / XML

Validating data with Flat File Checker

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
30 Oct 2009GPL32 min read 43.7K   881   17  
An article on data validation with a flat file schema generated in Flat File Checker.
Imports System.Threading
''' <summary>
''' Provides the interface for data rules.
''' </summary>
''' <remarks></remarks>
Public Interface IDataRule
    ReadOnly Property Type() As DataRuleType
    ''' <summary>
    ''' Runs validation of the data rule for all cells in the parent column.
    ''' </summary>
    ''' <param name="wait"></param>
    ''' <returns>true if process completed without errors.</returns>
    ''' <remarks></remarks>
    Function RunChecks(ByVal wait As AutoResetEvent) As Boolean
    ''' <summary>
    ''' Evaluates the value in the parent column at specific row.
    ''' </summary>
    ''' <param name="row">Number(zero-based) of the row in which value will be validated.</param>
    ''' <returns>true if value is valid.</returns>
    ''' <remarks></remarks>
    Function Evaluate(ByVal row As Integer) As Boolean
    ''' <summary>
    ''' Gets the column to wich the rule belongs to.
    ''' </summary>
    ''' <value></value>
    ''' <returns>Column instance.</returns>
    ''' <remarks></remarks>
    Property Column() As DataColumn
    ''' <summary>
    ''' Gest or sets an action that should be done when a value is invalid.
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property Action() As RowAction
    ReadOnly Property ErrorMessage() As String
    ''' <summary>
    ''' Gets or sets a value indicating whether this rule is a part of a where clause.
    ''' </summary>
    ''' <value></value>
    ''' <returns>true if the rule is a part of the where clause.</returns>
    ''' <remarks></remarks>
    Property InWhere() As Boolean
    ''' <summary>
    ''' Gest the rule that contains this rule.
    ''' </summary>
    ''' <value></value>
    ''' <returns>rule that contains this rule.</returns>
    ''' <remarks></remarks>
    Property Parent() As IDataRule
End Interface

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


Written By
Database Developer
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions