SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I create a Business Data catalog field with the object model? So I want to create a field that utilities business data catalog and not add an item to an already existing list.

share|improve this question

You will have to be a bit more precise. BDC fields are used in many places and can be defined in many ways: application definitions, user profiles, lists, lobsystems in web parts etc.

below is an example on how to instantiate a BDC field in an SPList, as this is something that usually causes a bit of trouble:

SPListItem item = someList.Items.Add();

// assign fields
item["MyProductID"] = EntityInstanceIdEncoder.EncodeEntityInstanceId(new object[]{"1234"}); // this could also be an integer 
item.Update();// alternatively use SystemUpdate
share|improve this answer
What I meant was that I want to create a list with the object model and then add a field to the list which is a Business Data Catalog field. So I want to add a field and not and item to the list. – Anonymous Mar 25 '10 at 12:25
Havent tested this myself, but found another question with answer on Microsoft forum:… You add field using AddFieldAsXml() and the xml definition for the field, and then connect it as a BusinessDataField using system instance, entity and field. – Anders Rask Mar 25 '10 at 13:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.