Adding a new column and values into a dataset

Discussion in 'ASP .Net' started by Do, Nov 15, 2003.

  1. Do

    Do Guest

    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
     
    Do, Nov 15, 2003
    #1
    1. Advertising

  2. Do

    Natty Gur Guest

    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


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Natty Gur, Nov 16, 2003
    #2
    1. Advertising

  3. Do

    Natty Gur Guest

    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


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Natty Gur, Nov 16, 2003
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dSchwartz
    Replies:
    2
    Views:
    2,195
    dSchwartz
    Mar 1, 2004
  2. =?Utf-8?B?QXNoYQ==?=

    adding new column to a dataset.

    =?Utf-8?B?QXNoYQ==?=, Aug 11, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    3,416
    =?Utf-8?B?QXNoYQ==?=
    Aug 11, 2004
  3. satria

    Adding new column to dataset

    satria, Oct 13, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    13,304
    satria
    Oct 13, 2005
  4. James
    Replies:
    0
    Views:
    514
    James
    Sep 21, 2006
  5. JDP@Work
    Replies:
    1
    Views:
    149
    JDP@Work
    Feb 23, 2005
Loading...

Share This Page