Using NotesSQL ODBC Driver and C# extract the .nsf file data to XML file format or any other format.
NoteSQL ODBC Driver Download Click Here
Sample Code:
public XmlDocument GetFromNSFdb(string strNSFdbName)
{
Domino.ISession session = new NotesSessionClass();
session.Initialize("");
Domino.NotesDatabase database = session.GetDatabase("", strNSFdbName, false); Domino.NotesNoteCollection noteCollecton = database.CreateNoteCollection(true); noteCollecton.SelectAllAdminNotes(true);
noteCollecton.SelectAllCodeElements(true);
noteCollecton.SelectAllDataNotes(true);
noteCollecton.SelectAllDesignElements(true);
noteCollecton.SelectAllFormatElements(true);
noteCollecton.SelectAllIndexElements(true);
noteCollecton.SelectForms = true;
noteCollecton.BuildCollection();
Domino.NotesDXLExporter exporter = (Domino.NotesDXLExporter session.CreateDXLExporter();
string strNsfXML = exporter.Export(noteCollecton);
// removes the string strDocrmv = strNsfXML.Replace("", "");
// removes the xmlns='http://www.lotus.com/dxl'
strDocrmv = strDocrmv.Replace("xmlns='http://www.lotus.com/dxl'", ""); XmlDocument xDocLoad = new XmlDocument();
xDocLoad.LoadXml(strDocrmv);
return xDocLoad;
}
No comments:
Post a Comment