custom column in VS2008 DataSet

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?
 
C

Cor Ligthert[MVP]

Cartoper,

Probably the most simple way to do it is already in your select

Select (FirstName + ' ' + LastName) as fullname from myTable

However, you can as well add an extra column in your program to your
datatable, where you do in fact almost the same in the expression.

The difficult way
http://msdn2.microsoft.com/en-us/library/0c5wf85e(VS.80).aspx

The simple way, try to avoid to understand the sample, it is much easier as
is written in that by leaving some parameters out in the easiest overload of
this method.
http://msdn2.microsoft.com/en-us/library/system.data.datacolumncollection.add(VS.71).aspx

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top