Retrieve subset of columns

  • Thread starter Thread starter Guy
  • Start date Start date
G

Guy

Does anyone know how to retrieve a subset of columns from a dataset?
I keep running into variations of this situation over and over and
have never found a solution. I must have missed some basic feature in
ADO.

I have a dataset with columns A, B and C. I need to pass a recordset
with ONLY columns A and B to another function outside my control.

I end up maintaining two datasets and it's a royal pain. I've found
tons and tons of information on getting subsets of the rows, combining
rows, rows this, rows that. Nothing on columns.

I end up either maintaining two separate datasets and trying to keep
them in synch, or building a second dataset from scratch off of the
first one by doing dataset.columns.add.
 
Hi Guy,

There is no clean way to do this.
BTW does it has to be datatable?
If not, you could create a wrapper that utilizes DataTable as source and
exposes only necessary columns.
I guess a wrapper could implement IBindingList and it should work.
 
Back
Top