Adding a new column and values into a dataset

D

Do

Hi,

I have a dataset that returns values.
I have done some calculation and

1) want to set the results into a label
that I have put into an itemtemplate in a datagrid.

2) Or just set the values to a new column in the existing dataset
and use that data for my datagrid

How do I go about doing this?

Do
 
N

Natty Gur

Hi,

1) add column :
DBColumn = New DataColumn()
DBColumn.ColumnName = "ItemValue"
DBColumn.DataType = System.Type.GetType("System.String")
DBTable.Columns.Add(DBColumn)

2) loop through rows and set new column data.

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
 
N

Natty Gur

Hi,

1) add column :
DBColumn = New DataColumn()
DBColumn.ColumnName = "ItemValue"
DBColumn.DataType = System.Type.GetType("System.String")
DBTable.Columns.Add(DBColumn)

2) loop through rows and set new column data.

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
 

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

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top