CJ

The circle of life – ** .Net – Training – MOSS **

  • Past Post

  • Vistor Locations

BDC return System.String[] type

Posted by Clayton James on November 5, 2007

I was receiving some really strange behaviour when returning data from a database using the BDC.

I was implementing some custom search functionality and mapped some MetaData Properties to fields from my database.

 

If you edit one of these properties you will see that you can include values from a variety of sources…AD, BDC, LDAP. Note: These mapped properties originally had multiple sources mapped.

So when I was performing my BDC query (using FullTextSqlQuery class) I was being returned a String[] for a couple of mapped properties. I thought well this is due to multiple properties being mapped, so I went into the screen shot above and removed other input sources to only have my BDC property mapped (as shown in picture). I performed a full crawl thinking all would be good….no, I was still being returned a String[] for EmployeeNo and EMail. I debugged the code and there was only one element in the Array which was the data I wanted. I was scratching my head, sifting through the BDC application definition file which identified both these fields as String, performing google/live searches…nothing.

In a last resort I removed the mapped properties, re-created them and re-mapped them to their corresponding BDC field. Completed a full re-crawl and thankfully this worked J. I was just about to give up and write a hack function that returned the single element.

This may also be why I was experiencing some problems. I originally imported a BDC application definition file with an instance name CorpDirAurion_Instance. This was deleted and re-imported with a name CorpDirAuirionInstance (you can see the two instance names in the dialog below). However, I cannot find a way to remove this instance from the crawled property selection dialog shown below. This instance has been deleted and I can’t find a reference to it anywhere and I can’t remove it from this dialog. No properties are mapped to any fields in this instance.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: