none
Datatable.ImportRow() not copying ? RRS feed

  • Question

  • I am copying a row from a table but it is leaving some fields blank. This is the code

     

     

    Code Snippet

    for(int i=0; i< takeoffsortedtable.Rows.Count; i++)

    {

    DataRow row = takeoffsortedtable.Rows[i];

    if (row["System ID"].ToString() == subquote.systemID.ToString())

    {

    foundSystem = true;

    dtSingleSystemSortedTable.ImportRow(row);//.Rows.im(row);

    }

    else

    if (foundSystem == true)

    {

    //since sorted we can break at the first non similar system id

    break;

    }

    }

     

     

    Now  takeoffsortedtable.RowsIdea[1].ToString() has a value of "1" and dtSingleSystemSortedTable.RowsIdea[1].ToString() has a value of ""

     

    Why? What can i do?

     

    Thanks

     

    Kev

     

    Wednesday, April 2, 2008 5:14 PM

Answers

  • Are your datatable schemas set up the same for both datatables?

     

    Could you post the code that sets the initial properties of your datatables?

    Wednesday, April 2, 2008 5:26 PM

All replies