QAS an Experian company
UK homeSupportTechnical document
Support
Support home
Pro zone
Authenticate Pro zone
Match zone
Pro On Demand zone
Pro Web zone
Batch zone
BANK WIZARD zone
NameTracer Pro zone
Rapid zone
Clicks zone
Data zone
Mailsort zone
Vista zone
Downloads
FAQs
Training
Solution accreditation
Licensing
Contact support
QuickAddress is now QAS

Rate this area

Please rate the Knowledge base area:

Support site feedback
Please tell us what you think

Send this page to a friendSend this
page to a friend

Technical Document

How do I integrate QAS APIs using C#.NET?

Category

Development

Product Line

All

Product

Batch, Dedupe, Listbuilder, Lite, Locator, Mailsort, Names, NameTracer, Nearest, Nearest Web, Pro, Pro Web, Pro with business, Pro with names, RAS, Server, Server Tools, Walksort

Implementation

API, UI API, Primary API (low level), Web API

O/S

Windows

Version

4.x, 4.5, 4.51, 4.50, 4.05, 4.04, 4.1x, 4.10, 4.0x, 4.03, 4.02, 4.01, 4.01, 4.00, 3.x, 3.7, 3.70, 3.62, 3.61, 3.5x, 3.50, 3.3x, 3.35, 3.34, 3.33, 3.30, 3.2x, 3.23, 3.22, 3.20, 3.1x, 3.19, 3.18, 3.17, 3.16, 3.15, 3.131, 3.130, 3.11, 3.11, 3.10, 3.0x, 3.090, 3.080, 3.07, 3.05, 3.04, 3.02, 3.01, 3.00, 2.x, 2.32, 2.31, 2.30, 2.23, 2.21, 2.20, 2.111, 2.10, 2.060, 2.040, 2.03, 2.01, 2.00, 1.x, 1.8, 1.00

Search support:
Look in:
Knowledge base
Support site
Advanced search

Summary

The following document outlines how to interface with QAS API’s using the C#.NET development environment.

Solution

1. Interfacing with the DLL

The way to interface with the dll in C# is to use the DllImport command as indicated below followed by the name of the dll. This example shows how to integrate with the QAS Rapid API.

[DllImport("qaruieb.dll", CharSet=CharSet.Ansi)] public static extern

int QARapid_ListItem(int vl1

,[MarshalAs(UnmanagedType.LPStr)]StringBuilder sBuffer,int vi3 , int vi4

);

Also notice that buffers such as sBuffer which need to retain information should be declared using MarshalAs and the StringBuilder Object as described in the next section.

2. Using the C# StringBuilder Object

In C# the correct way to pass a string by reference is to use a StringBuilder Object (System.text.stringbuilder). For example, the following sample code illustrates how to display the first item resulting from a search on BA99lt:

int icode;

StringBuilder rsBuffer = new StringBuilder(100);

icode=QARapid_Open("","");

icode=QARapid_Search("BA99lt");

icode=QARapid_ListItem(0,rsBuffer,0,100);

MessageBox.Show(rsBuffer.ToString(0,rsBuffer.Length));

Common Problems

The most common is failure to retain address information after making a function call. This is due to the fact that some elements need to be passed by reference.

Symptoms of an address not being returned correctly:

The symptoms are normally very easy to detect and commonly will result in blank spaces or garbage being returned to the address buffer. When this happens it is a good idea to set up API logging (see the link below) to confirm that nothing is being passed back and retained.

Related links

How do I solve problems with QAS API integrations?