New Column to DataSet.DataTable

  • Thread starter Thread starter Xarky
  • Start date Start date
X

Xarky

Hi,
I am making a query to a database, that is returning a DataSet. The
DataSet contains one table, columns and rows of data.

Now, for that same table, I need to add a new column(Column New).
This new column will contain data retrieved from the same table and
have some functionality applied to it. New Column is to be kept
locally, and datasource is not to be updated.

How can I do this? Should I create a new dataset?

******* Table ******
Column x Column New
5 func(5)
6 func(6)
.....


I hope someone understands my problem and can help me out.
Thanks in Advance
 
Xarky,

In fact are it two questions.
The first is easy to answer with this link
http://msdn.microsoft.com/library/d.../frlrfsystemdatadatacolumnclassctortopic4.asp

When you mean with the datasource the database, than it is easy to answer,
the update does only those columns which are in the update commands (insert,
update) from the dataadapter or whatever.

When you mean a datasource for a datagrid or whatever than you have in my
opinon to tell that to get a good answer, and than as well as it is a
datagrid if it is web or windowforms.

I hope this helps,

Cor
 
Hi,
I was not clear in my query. What I wanted to write is the following:

I need to retrieve data from a database. The DataSet returned needs to
be manipulated(my previous query, create a new dataSet, or if possible
add a newColumn to it) and the the new DataSet is to act as a datasource
to a datagrid in my webform.
 
Xarky,
I was not clear in my query. What I wanted to write is the following:

I need to retrieve data from a database. The DataSet returned needs to
be manipulated(my previous query, create a new dataSet, or if possible
add a newColumn to it) and the the new DataSet is to act as a datasource
to a datagrid in my webform.
See the link I gave, normally you can use your original datatable by the
way.

I hope this helps,

Cor
 
Thanks for your help. I used the original table, created a new column
in it, and then looped through all the rows to create data wanted.
 
Back
Top