我有一個簡單的二維數組字符串,我想將它填充到MOSS中的SPFieldMultiLineText中。這映射到ntext數據庫字段。在C#中使用不使用文件系統的序列化
我知道我可以序列化到XML並存儲到文件系統,但我想序列化而不接觸文件系統。
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
}
看起來我應該能夠做這樣的事情:
XmlSerializer s = new XmlSerializer(typeof(List<List<string>>));
properties.AfterProperties["myNoteField"] = s.Serialize.ToString();
,但不起作用。我找到的所有示例都演示了寫入文本文件。
通過一個字節數組去?哎喲。 – bzlm 2009-02-20 09:34:53