I have a simple 2D array of strings and I would like to stuff it into an SPFieldMultiLineText in MOSS. This maps to an ntext database field.
I know I can serialize to XML and store to the file system, but I would like to serialize without touching the filesystem.
public override void ItemAdding(SPItemEventProperties properties) { // build the array List<List<string>> matrix = new List<List<string>>(); /* * populating the array is snipped, works fine */ // now stick this matrix into the field in my list item properties.AfterProperties['myNoteField'] = matrix; // throws an error }
Looks like I should be able to do something like this:
XmlSerializer s = new XmlSerializer(typeof(List<List<string>>)); properties.AfterProperties['myNoteField'] = s.Serialize.ToString();
but that doesn’t work. All the examples I’ve found demonstrate writing to a text file.
1 Answer