Load EDI Data From String

Index

    Load Data From String

    EDIFileLoader allows developers to load EDI files from the file system using the EDIFile property as well as from a string of EDI data using the EDIDataString property. You can create an entire EDI string containing EDI data from your applications and pass it into the EDIFileLoader’s EDIDataString property. Loading will continue as normal after calling the Load() method.

    Example

    // Create a new instance of EDIFileLoader
    EDIFileLoader loader = new EDIFileLoader();

    loader.AutoDetectDelimiters = true;

    // Set the type of EDI file that you are about the load
    loader.EDIFileType = FileType.X12; //Or FileType.EDIFACT

    // Set the source of EDI data, whether you are validating from an in-memory string or a file
    loader = EDISource.DataString; // Or EDISource.File

    // Set the EDI data to load
    loader.EDIDataString = “SEG*12*122*~SEG2*7*2~”;

    // Load the data
    EDILightWeightDocument loadedDocument = loader.Load();

    in EDI File Loader
    Did this article answer your question?