cancel
Showing results for 
Search instead for 
Did you mean: 

Any Csharp examples of Unity Autofills from an External Database

Scott_Johnson3
World-Class Innovator
World-Class Innovator

Hi All

With 13 we acan now use ,net code for autofills (about time!  Smile).  The example in SDK is weak and does not use an external db and is in VB.  Does anyone have a csharp production quality examples of a unity autofill accessing an external database?

Thanks

Scott

2 REPLIES 2

Timothy_Cosgrif
Star Collaborator
Star Collaborator

For a reference on how to connect to an external DB, see Unity API > Programmer Guide > Managing Unity Scripts and Projects > Creating Connection Strings.

That will show you how to set up connection strings to external databases so that you can call Application.Configuration.GetConnection to get a connection to an external database.

Unfortunately, we cannot give out full solutions, but since it's not in the SDK (I will put in a request to get it added), here are some things to know about External Autofills.

The ExternalAutofillKeysetEventArgs object passed into the script exposes 3 properties. The primary keyword, the related keyword types, and the results.

The Results property exposes two methods, CreateExternalAutofillKeysetData() and AddExternalKeywordAutofillKeysetData(). 

Using the ExternalAutofillKeysetData object returned from the create method, you can set all of the keywords in that set (using the SetKeyword method). You can do this as many times as you need (depending on the results of your external query).

Hopefully that clears things up a bit.

Scott_Johnson3
World-Class Innovator
World-Class Innovator

Thanks Tim for the info.  Please post a note to this thread when samples are availible.

Scott