A Repasky

A Repasky

  • NA
  • 231
  • 183.2k

Re-adding a List

Oct 4 2011 3:48 PM
I am saving a Code and Description in a List<T>.

As I get all the Codes and Description from the database I am storing them in the List.  But a few of the Descriptions have a second entry with the same Code to continue the Desciption that does not fit in the first entry field.  So I add it to the Description and want to overwrite the List item.  Just doing an Add does not do it.  So I thought that if I find the index with IndexOf and do a RemoveAt and then do an Add again it would do it and it does not abort, but does not store anything.

Here is the code.
            reasonList.IndexOf(myReason, indx);
            reasonList.RemoveAt(indx);
            reasonList.Add(new ReasonRecord(dataRowItem["Code"].ToString(), myReasonDesc));






myReasonDesc is the Description that adds the second Description to the first Description.




Say the first Description is "CLAIM WAS PAID UNDER THE NATIONAL PREFERRED" and
the second is " PROVIDER NETWORK". I now want to store the

"CLAIM WAS PAID UNDER THE NATIONAL PREFERRED  PROVIDER NETWORK"





How can I do this?
Thanks for any help.



arep

Answers (9)