【发布时间】:2026-01-23 12:35:01
【问题描述】:
我有一个简单的二维字符串数组,我想将它填充到 MOSS 中的 SPFieldMultiLineText 中。这映射到一个 ntext 数据库字段。
我知道我可以序列化为 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();
但这不起作用。我发现的所有示例都演示了写入文本文件。
【问题讨论】:
标签: c# sharepoint serialization moss wss