none
Taking values from one data table column, and adding to another data table's column RRS feed

  • Question

  • I have a table called CheckedFiles with a column called filesChecked, and a table called startDate, which depending on any advice I can get, has a column called FilesChecked. What I want to do, is to literally take the values in the FilesChecked column in CheckedFiles, and put them into the column FilesChecked in the startDate table. 


    Tuesday, March 12, 2019 12:00 PM

All replies

  • Hi voot,

    We need a bit more information about what you want to accomplish ... is there only one row in each table? If so, then it's easy:

    dtstartDate.Rows[0]["FilesChecked"] =  dtCheckedFiles.Rows[0]["filesChecked"];

    If you have more rows in either table, then we're going to need more information about how you want to go about processing the rows.


    ~~Bonnie DeWitt [C# MVP]

    http://geek-goddess-bonnie.blogspot.com

    Wednesday, March 13, 2019 12:57 AM
  • Hi Bonnie. 

    Ok, so in the checkedFiles table, there can be any number of rows, ranging from 1 upwards. The table it's going into (startDate), will contain just one row. 

    With your reply so far, it's really good in that it brings though one row, with all of the data in one row, but the FilesChecked column needs to potentially have a column that spans further than one row.
    • Edited by voot1989 Wednesday, March 13, 2019 8:56 AM
    Wednesday, March 13, 2019 8:51 AM
  • With your reply so far, it's really good in that it brings though one row, with all of the data in one row, but the FilesChecked column needs to potentially have a column that spans further than one row.

    I'm really not sure what you mean by that. Do you mean you need to add additional rows to the startDate table? If so, what will be in those rows (other than the FilesChecked column). Are these identical tables? (probably not) Can you give us a bit more info about how these tables are going to be used?


    ~~Bonnie DeWitt [C# MVP]

    http://geek-goddess-bonnie.blogspot.com

    Wednesday, March 13, 2019 1:53 PM