Click or drag to resize

DataExchange Methods

The DataExchange type exposes the following members.

Methods
  NameDescription
Public methodDataExchangeSqlImport Obsolete.
The CodeMethod shall take a SQL statement and a SQL connection, and fetch all the data from the SQL Server and save them to a CSV file, and upload the CSV file to a new version of a DataExchange file. The Data Exchange should already have a file attached
Codemethod usage
Designed to be used in a process only (Yes/No) No
Action Object (data object type) N/A

Code method configuration must hold database connection and command information as well as the data exchange UId

Example of code method configuration:

<DataExchangeSqlImport>
 <CommandText>select a, b, c from tbl_d</CommandText>
 <ConnectionString>User ID=sa;Initial Catalog=SomeDatabase</ConnectionString>
 <DataExchangeUid>xxxx-xxxx-xxxx-xxxx-xxxx</DataExchangeUid>
</DataExchangeSqlImport>

Public methodUploadAndExecute Obsolete.
Execute a data exchange that is used for importing data from a CSV file to the current application. The CSV file can either be located on a server or the local machine.
Codemethod usage
Designed to be used in a process only (Yes/No)No
Action Object (data object type)N/A

The function will: 1.Impersonate the client, if his/her username and password are valid for the server of the given domain 2.Compare the give textfile configuration's file version with its matching file with the given path in the server 3.If the server file is newer than the configuration file then create new file version for the data exchange configuration 4.Execute the data exchange

Example of a configuration for data exchanging from a file on a remote server:

<UploadAndExecute>
 <DataExchangeId>1001</DataExchangeId>
 <UNCPath>\\Filesrv01\Shared\AppFile\UploadAndExecuteTest.csv</UNCPath>
 <Domain>OMADA</Domain>
 <Username>sm</Username>
 <Password>Superman1</Password>
</UploadAndExecute>

Example from a local machine:

<UploadAndExecute>
 <DataExchangeId>1001</DataExchangeId>
 <UNCPath>C:\Temp\UploadAndExecuteTest.csv</UNCPath>
</UploadAndExecute>

Top
Extension Methods
  NameDescription
Public Extension MethodToBool
Converts object to boolean.
(Defined by ObjectExtensions.)
Public Extension MethodToDateTime
Converts object to DateTime.
(Defined by ObjectExtensions.)
Public Extension MethodToInt
Converts object to integer.
(Defined by ObjectExtensions.)
Top
See Also