Adding fields/columns to DataSet

  • Thread starter Thread starter Cartoper
  • Start date Start date
C

Cartoper

I am working on my first VS2008 project and using DataSet's, which I
am not super familar with. I have a user table in the data set that
has a first name and last name, I would like to add a computed field/
column that is "<fname> <last name>". In .Net 3.5, what is the best
way to do this?

Cartoper
 
Cartoper,

Look at the documentation for the DataColumn class, specifically, the
constructor which takes an expression:

http://msdn2.microsoft.com/en-us/library/aa325508(VS.71).aspx

As well as the documentation for the Expression property itself on the
DataColumn class:

http://msdn2.microsoft.com/en-us/library/system.data.datacolumn.expression(VS.71).aspx

Then, you will want to call Add on the DataColumnCollection on the
DataTable exposed through the Columns property:

http://technet.microsoft.com/en-us/library/55b10992.aspx
 
Back
Top