the number of records is irellevant (sp). applying a column expression to a column affects all rows.
if you have 10-20 columns then you would add a column for each pair. you could create a helper function to speed up the process as well.
public class DataTableHelper
{
private DataTable table;
public DataTableHelper(DataTable table)
{
if(table == null)
{
throw new ArgumentNullException("table");
}
this.table = table;
}
public void AddColumn(DataColumn desc, DataColumn id)
{
string expression = string.Format(@"[{0}] + " (" + [{1}] + ")" ", desc.ColumnName, id.ColumnName);
string columnName = desc.ColumnName + id.ColumnName;
this.table.Columns.Add(columnName, typeof(string), expression);
}
}
it would be implemented like this
DataTable t = new DataTable();
adapter.FetchTypedList(fields, t, ...);
DataTableHelper helper = new DataTableHelper(t);
helper.AddColumn(t.Columns[1], t.Columns[0]);
helper.AddColumn(t.Columns[x], t.Columns[y]);
...
i altered the format expression string slightly. again this may need to be adjusted to produce the correct results, but you get the idea.