Using NotesSQL ODBC Driver and C# extract the .nsf file data

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;

}

Comments

Popular posts from this blog

ASP.NET website "Cannot read configuration file due to insufficient permissions" in IIS 7 and Windows Server 2008

Error occurred in deployment step 'Install app for SharePoint': The System Account cannot perform this action.

None of the selected features can be installed or upgraded. Setup cannot proceed since no