Results 1 to 2 of 2

Thread: datagrids - extra column

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2004
    Posts
    4

    Question datagrids - extra column

    Hi,

    I fill a datagrid with data from some tables. Now I want an extra column wich contains the outcome of a multiplication of two other columns, For instance:

    columns 1 and 2 contain data from datatables:

    (number) (price)
    2 13

    I want a third column:

    (number) (price) (to pay)
    2 13 26


    Can Anyone help me with this?

    Thanks, kleedje

  2. #2
    Frenzied Member mar_zim's Avatar
    Join Date
    Feb 2004
    Location
    Toledo Cebu City.
    Posts
    1,416
    do like this
    VB Code:
    1. 'da is an Sqldataadapter
    2. Dim dt As DataTable = New DataTable("sampletable")
    3.         da.Fill(dt)
    4. Dim dc As DataColumn = New
    5. DataColumn()
    6.         dc.ColumnName = "mzim"
    7.         dc.DefaultValue = " "
    8.         dt.Columns.Add(dc)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width