Validating Strings


    Validating Strings

    EDIValidator allows you to validate EDI files from your file system using the EDIFile property as well as from a string of EDI text using the EDIDataString property. You can create an entire EDI string containing EDI data from your applications and pass it into the EDIValidator’s EDIDataString property. Validation will continue as normal after calling the Validate() method.


    // Create a new instance of EDIValidator
    EDIValidator validator = new EDIValidator();

    // Set the type of EDI file that you are about the validate
    validator.EDIFileType = FileType.X12;

    // Set the source of EDI data, whether you are validating from an in-memory string or a file

    validator.EDISource = EDISource.DataString; // Or EDISource.File

    // Set the EDI rules file
    validator.EDIRulesFile = “C:\\EDIFile.Rules”;

    // Set the EDI file to validate
    validator.EDIDataString= “SEG*12*122*~SEG2*7*2~”;

    // Validate


    in EDI Validator
    Did this article answer your question?