|
| 1 | +--- |
| 2 | +id: load-database-document-with-options |
| 3 | +url: conversion/net/load-database-document-with-options |
| 4 | +title: Load Database Documents with Options |
| 5 | +weight: 15 |
| 6 | +description: "Learn how to use DatabaseLoadOptions to configure database document loading in GroupDocs.Conversion for .NET. Supports NSF (Lotus Notes) and SQL formats." |
| 7 | +keywords: DatabaseLoadOptions, load database, NSF, SQL, Lotus Notes, database conversion, GroupDocs.Conversion |
| 8 | +productName: GroupDocs.Conversion for .NET |
| 9 | +hideChildren: False |
| 10 | +toc: True |
| 11 | +--- |
| 12 | + |
| 13 | +## Introduction |
| 14 | + |
| 15 | +The **DatabaseLoadOptions** class enables you to configure how database documents and scripts are loaded in GroupDocs.Conversion. This class supports enterprise database formats used in corporate environments and database administration. |
| 16 | + |
| 17 | +DatabaseLoadOptions works with database formats including NSF (Lotus Notes/IBM Notes storage) and SQL (Structured Query Language scripts). |
| 18 | + |
| 19 | +## Properties |
| 20 | + |
| 21 | +| Property | Type | Description | |
| 22 | +|----------|------|-------------| |
| 23 | +| `Format` | `DatabaseFileType` | The input database format (get; set;) | |
| 24 | + |
| 25 | +## Basic Usage |
| 26 | + |
| 27 | +For most scenarios, GroupDocs.Conversion automatically detects the database format: |
| 28 | + |
| 29 | +```csharp |
| 30 | +using (var converter = new Converter("customer-records.nsf")) |
| 31 | +{ |
| 32 | + converter.Convert("customer-records.pdf", new PdfConvertOptions()); |
| 33 | +} |
| 34 | +``` |
| 35 | + |
| 36 | +## Using DatabaseLoadOptions with LoadContext |
| 37 | + |
| 38 | +When you need explicit control over loading behavior, use DatabaseLoadOptions with the LoadContext delegate pattern: |
| 39 | + |
| 40 | +```csharp |
| 41 | +using (var converter = new Converter( |
| 42 | + "email-archive.nsf", |
| 43 | + (LoadContext loadContext) => new DatabaseLoadOptions())) |
| 44 | +{ |
| 45 | + converter.Convert("email-archive.pdf", new PdfConvertOptions()); |
| 46 | +} |
| 47 | +``` |
| 48 | + |
| 49 | +## Working with Different Database Formats |
| 50 | + |
| 51 | +GroupDocs.Conversion supports multiple database formats through DatabaseLoadOptions. Each format should be explicitly specified: |
| 52 | + |
| 53 | +### NSF (Lotus Notes Storage Facility) |
| 54 | + |
| 55 | +NSF is the database file format used by IBM Notes (formerly Lotus Notes), commonly used for storing emails, calendars, documents, and forms in enterprise environments: |
| 56 | + |
| 57 | +```csharp |
| 58 | +using (var converter = new Converter( |
| 59 | + "project-notes.nsf", |
| 60 | + (LoadContext loadContext) => new DatabaseLoadOptions |
| 61 | + { |
| 62 | + Format = DatabaseFileType.Nsf |
| 63 | + })) |
| 64 | +{ |
| 65 | + converter.Convert("project-notes.pdf", new PdfConvertOptions()); |
| 66 | +} |
| 67 | +``` |
| 68 | + |
| 69 | +**Common use cases:** |
| 70 | +- Email archives and mailbox exports |
| 71 | +- Corporate document management systems |
| 72 | +- Project collaboration databases |
| 73 | +- Team calendars and scheduling systems |
| 74 | + |
| 75 | +### SQL (Structured Query Language) |
| 76 | + |
| 77 | +SQL files contain database scripts and queries used to create, modify, or query relational databases: |
| 78 | + |
| 79 | +```csharp |
| 80 | +using (var converter = new Converter( |
| 81 | + "schema-definition.sql", |
| 82 | + (LoadContext loadContext) => new DatabaseLoadOptions |
| 83 | + { |
| 84 | + Format = DatabaseFileType.Sql |
| 85 | + })) |
| 86 | +{ |
| 87 | + converter.Convert("schema-definition.pdf", new PdfConvertOptions()); |
| 88 | +} |
| 89 | +``` |
| 90 | + |
| 91 | +**Common use cases:** |
| 92 | +- Database schema documentation |
| 93 | +- Migration script archives |
| 94 | +- SQL query documentation |
| 95 | +- Database backup scripts as PDF |
| 96 | + |
| 97 | +## Converting Multiple Database Formats |
| 98 | + |
| 99 | +Convert different database formats in a single workflow: |
| 100 | + |
| 101 | +```csharp |
| 102 | +// NSF to PDF |
| 103 | +using (var converter = new Converter( |
| 104 | + "team-calendar.nsf", |
| 105 | + (LoadContext loadContext) => new DatabaseLoadOptions |
| 106 | + { |
| 107 | + Format = DatabaseFileType.Nsf |
| 108 | + })) |
| 109 | +{ |
| 110 | + converter.Convert("team-calendar.pdf", new PdfConvertOptions()); |
| 111 | +} |
| 112 | + |
| 113 | +// SQL to PDF |
| 114 | +using (var converter = new Converter( |
| 115 | + "migration-script.sql", |
| 116 | + (LoadContext loadContext) => new DatabaseLoadOptions |
| 117 | + { |
| 118 | + Format = DatabaseFileType.Sql |
| 119 | + })) |
| 120 | +{ |
| 121 | + converter.Convert("migration-script.pdf", new PdfConvertOptions()); |
| 122 | +} |
| 123 | +``` |
| 124 | + |
| 125 | +## Supported Database Formats |
| 126 | + |
| 127 | +DatabaseLoadOptions works with: |
| 128 | +- **NSF** - Notes Storage Facility (IBM Notes/Lotus Notes database format) |
| 129 | +- **SQL** - Structured Query Language scripts and queries |
| 130 | + |
| 131 | +## Common Use Cases |
| 132 | + |
| 133 | +Use DatabaseLoadOptions when you need to: |
| 134 | + |
| 135 | +1. **Archive email systems** - Convert Lotus Notes mailboxes to PDF for long-term storage |
| 136 | +2. **Document database schemas** - Create PDF documentation from SQL scripts |
| 137 | +3. **Compliance and auditing** - Convert database documents for regulatory compliance |
| 138 | +4. **Knowledge management** - Extract and convert corporate knowledge from Notes databases |
| 139 | +5. **Database documentation** - Generate readable documentation from SQL scripts |
| 140 | +6. **Legacy system migration** - Convert old Lotus Notes databases to modern formats |
| 141 | + |
| 142 | +## When to Use DatabaseLoadOptions |
| 143 | + |
| 144 | +Use DatabaseLoadOptions when: |
| 145 | + |
| 146 | +- Converting Lotus Notes/IBM Notes databases (NSF) |
| 147 | +- Processing SQL scripts and database queries |
| 148 | +- Working with enterprise database documentation |
| 149 | +- Archiving corporate email and collaboration data |
| 150 | +- You need explicit control over database document loading |
| 151 | + |
| 152 | +## Without DatabaseLoadOptions |
| 153 | + |
| 154 | +For simple conversions, you can rely on automatic format detection: |
| 155 | + |
| 156 | +```csharp |
| 157 | +using (var converter = new Converter("customer-records.nsf")) |
| 158 | +{ |
| 159 | + converter.Convert("customer-records.pdf", new PdfConvertOptions()); |
| 160 | +} |
| 161 | +``` |
| 162 | + |
| 163 | +GroupDocs.Conversion automatically detects the database format in most cases, so DatabaseLoadOptions is optional unless you need specific loading configuration. |
| 164 | + |
| 165 | +## Output Format Compatibility |
| 166 | + |
| 167 | +Database documents can be converted to various output formats: |
| 168 | + |
| 169 | +- **Document formats**: PDF, DOCX, TXT, RTF |
| 170 | +- **Web formats**: HTML, MHTML |
| 171 | +- **Spreadsheet formats**: XLSX, XLS |
| 172 | +- **Presentation formats**: PPTX, PPT |
| 173 | +- **Image formats**: PNG, JPG, TIFF (page-by-page conversion) |
| 174 | + |
| 175 | +## NSF Format Details |
| 176 | + |
| 177 | +The NSF format is a container that can include: |
| 178 | +- Email messages |
| 179 | +- Calendar entries |
| 180 | +- Contact information |
| 181 | +- Documents and attachments |
| 182 | +- Forms and views |
| 183 | +- Access control lists |
| 184 | + |
| 185 | +When converting NSF files, GroupDocs.Conversion processes the database structure and content, making it suitable for archival and documentation purposes. |
| 186 | + |
| 187 | +## SQL Format Details |
| 188 | + |
| 189 | +SQL files typically contain: |
| 190 | +- CREATE TABLE statements |
| 191 | +- ALTER TABLE modifications |
| 192 | +- INSERT/UPDATE/DELETE operations |
| 193 | +- SELECT queries |
| 194 | +- Stored procedures |
| 195 | +- Database constraints and indexes |
| 196 | + |
| 197 | +Converting SQL files to PDF creates readable documentation of database schemas and operations, useful for: |
| 198 | +- Code reviews |
| 199 | +- Database design documentation |
| 200 | +- Training materials |
| 201 | +- Change management records |
| 202 | + |
| 203 | +## Summary |
| 204 | + |
| 205 | +DatabaseLoadOptions provides control over database document loading: |
| 206 | +- **Format**: Specify NSF or SQL format explicitly |
| 207 | +- **Supports**: IBM Notes databases (NSF) and SQL scripts |
| 208 | +- **Use Case**: Enterprise data archival, compliance, database documentation |
| 209 | + |
| 210 | +All examples on this page have been verified through automated testing to ensure accuracy. |
| 211 | + |
| 212 | +## See Also |
| 213 | + |
| 214 | +- [Context Objects - Complete Guide]({{< ref "conversion/net/developer-guide/basic-usage/context-objects-complete-guide" >}}) |
| 215 | +- [DatabaseFileType API Reference](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.filetypes/databasefiletype/) |
| 216 | +- [DatabaseLoadOptions API Reference](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.load/databaseloadoptions/) |
0 commit comments