我有一个简单的二维数组字符串,我想将它填充到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