Last active
November 8, 2019 15:00
-
-
Save GroupDocsGists/5f9beb5ce2a3e3c5e14fca657762b649 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string connectionString = string.Format("Provider=System.Data.Sqlite;Data Source={0};Version=3;", "sqlite.db"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Iterate over tables | |
foreach (TocItem i in toc) | |
{ | |
// Print the table name | |
Console.WriteLine(i.Text); | |
// Extract a table content as a text | |
using (TextReader reader = parser.GetText(i.PageIndex.Value)) | |
{ | |
Console.WriteLine(reader.ReadToEnd()); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get a list of tables | |
IEnumerable<TocItem> toc = parser.GetToc(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using (Parser parser = new Parser(connectionString, new LoadOptions(FileFormat.Database))) | |
{ | |
// your code goes here | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using GroupDocs.Parser.Data; | |
using GroupDocs.Parser.Options; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string connectionString = string.Format("Provider=System.Data.Sqlite;Data Source={0};Version=3;", "sqlite.db"); | |
// Create an instance of Parser class to extract tables from the database. | |
// Connection string is passed as first parameter and LoadOptions is set to Database file format. | |
using (Parser parser = new Parser(connectionString, new LoadOptions(FileFormat.Database))) | |
{ | |
// Get a list of tables | |
IEnumerable<TocItem> toc = parser.GetToc(); | |
// Iterate over tables | |
foreach (TocItem i in toc) | |
{ | |
// Print the table name | |
Console.WriteLine(i.Text); | |
// Extract a table content as a text | |
using (TextReader reader = parser.GetText(i.PageIndex.Value)) | |
{ | |
Console.WriteLine(reader.ReadToEnd()); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment