HomeActive Query BuilderEventMetadataProvider - show primary key

EventMetadataProvider - show primary key


Hi,

Table objects from all standard metadataprovider now show primary keys. I have a metadataprovider derived from the EventMetadataProvider, how can I show the tabble object primary key.

Thanks.
QD | email
September 1 2008, 04:19 AM
You need to set the PrimaryKey property of the MetadataField object when adding fields in the GetFieldNames event handler:

void EventMetadataProvider_GetFieldNames(BaseMetadataProvider sender, MetadataObject obj)
{
MetadataField mf = obj.Fields.AddField("Field 1");
mf.PrimaryKey = true;
}
Eugene Starkov | email
2 hours, 10 mins since original post
This topic is closed