C
ctd
Hi,
This is urgent so I hope someone can help. Thanks.
I tried to display a dropdown list of a custom field's values, but kept
having
zero record return. Checked the database and saw my custom field in the
custom field table and its values in the lookup table. Not sure what I was
missing in the code but no record was returned. Below is my code in C#:
private CustomFieldWS.CustomFieldDataSet readCustomFieldDS =
new CustomFieldWS.CustomFieldDataSet();
private LookupTableWS.LookupTableDataSet lookupDS =
new LookupTableWS.LookupTableDataSet();
private void ReadCustomFields()
{
strCustField = "Classification";
DataView dataview = new DataView(readCustomFieldDS.CustomFields);
dataview.RowFilter =
readCustomFieldDS.CustomFields.MD_PROP_NAMEColumn.ColumnName +
" = '" + strCustField + "'";
if (dataview.Count == 0) return;
CustomFieldWS.CustomFieldDataSet.CustomFieldsRow rowCF =
(CustomFieldWS.CustomFieldDataSet.CustomFieldsRow)dataview[0].Row;
foreach (LookupTableWS.LookupTableDataSet.LookupTableTreesRow
row in lookupDS.LookupTableTrees.Rows)
{
if (rowCF.MD_LOOKUP_TABLE_UID == row.LT_UID)
{
ddlTitleClass.Items.Add(row.LT_VALUE_TEXT);
}
}
}
This is urgent so I hope someone can help. Thanks.
I tried to display a dropdown list of a custom field's values, but kept
having
zero record return. Checked the database and saw my custom field in the
custom field table and its values in the lookup table. Not sure what I was
missing in the code but no record was returned. Below is my code in C#:
private CustomFieldWS.CustomFieldDataSet readCustomFieldDS =
new CustomFieldWS.CustomFieldDataSet();
private LookupTableWS.LookupTableDataSet lookupDS =
new LookupTableWS.LookupTableDataSet();
private void ReadCustomFields()
{
strCustField = "Classification";
DataView dataview = new DataView(readCustomFieldDS.CustomFields);
dataview.RowFilter =
readCustomFieldDS.CustomFields.MD_PROP_NAMEColumn.ColumnName +
" = '" + strCustField + "'";
if (dataview.Count == 0) return;
CustomFieldWS.CustomFieldDataSet.CustomFieldsRow rowCF =
(CustomFieldWS.CustomFieldDataSet.CustomFieldsRow)dataview[0].Row;
foreach (LookupTableWS.LookupTableDataSet.LookupTableTreesRow
row in lookupDS.LookupTableTrees.Rows)
{
if (rowCF.MD_LOOKUP_TABLE_UID == row.LT_UID)
{
ddlTitleClass.Items.Add(row.LT_VALUE_TEXT);
}
}
}