locked
DataTable Value to a DataRow RRS feed

  • Question

  • User2012297617 posted

    I need to get a DataTable value and move it to DataRow (another DataTable)

    How would I do that?

     

    I was doing    dr[index] = dtMasterData.Rows.ToString();    As a result I get: System.Data.DataRowCollection

    Any feedback will be greatly appreciated. Thx.

    Monday, April 23, 2012 2:57 PM

Answers

  • User-851967432 posted

    If you already have the datarow, you can simply add it with something like datatable.rows.add(dr[0])

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, April 23, 2012 3:01 PM

All replies

  • User-851967432 posted

    If you already have the datarow, you can simply add it with something like datatable.rows.add(dr[0])

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, April 23, 2012 3:01 PM
  • User2012297617 posted

    dr[index] belongs to another DataTable.     dtMasterData is the main data source.   I'm trying to put the value of dtMasterData multiple times into a single DataTable.  I'm collecting multiple users data.

     

    Monday, April 23, 2012 3:15 PM
  • User2012297617 posted

    That worked Adam. Thx a lot!

    Monday, April 23, 2012 4:33 PM