We had a database with alot of lookup tables (ie State Lookup Table, Credit Card Look Up table). We generalized All of these tables to two simple tables. One of the tables stores the generic name value pairs. Both name/value are varchar's because in some instances we will store chars and in other we will store ints.
At run time we can't do databinding because the tables which store the foreign key value store them as mostly as ints.
So basically I need to add an integer type field to my collection at run time if I know it's values are ints.
Whew... I hope this is readable.
Currently my solution is to put it out to a datatable
public DataTable GetCodesAsIntegersInDataTable(int CodeTypeID){
filter = new PredicateExpression();
filter.Add(new PredicateExpression(PredicateFactory.CompareValue(BLMaster.CodesFieldIndex.CodeTypeId, ComparisonOperator.Equal, CodeTypeID)));
DataTable dt = GetMultiAsDataTable(filter, 0, sorter);
dt.Columns.Add(new DataColumn("CodeCodeInt", typeof(System.Int32), "CodeCode"));
return dt;
}
So this works because I can bind with CodeCodeInt.
I would like to see if it is possible to still use the collection itself while doing the same thing. Any Ideas?