Index: System.Data.SQLite/SQLiteModuleEnumerable.cs ================================================================== --- System.Data.SQLite/SQLiteModuleEnumerable.cs +++ System.Data.SQLite/SQLiteModuleEnumerable.cs @@ -215,11 +215,50 @@ /// /// This class implements a virtual table module that exposes an /// object instance as a read-only virtual /// table. It is not sealed and may be used as the base class for any /// user-defined virtual table class that wraps an - /// object instance. + /// object instance. The following short + /// example shows it being used to treat an array of strings as a table + /// data source: + /// + /// public static class Sample + /// { + /// public static void Main() + /// { + /// using (SQLiteConnection connection = new SQLiteConnection( + /// "Data Source=:memory:;")) + /// { + /// connection.Open(); + /// + /// connection.CreateModule(new SQLiteModuleEnumerable( + /// "sampleModule", new string[] { "one", "two", "three" })); + /// + /// using (SQLiteCommand command = connection.CreateCommand()) + /// { + /// command.CommandText = + /// "CREATE VIRTUAL TABLE t1 USING sampleModule;"; + /// + /// command.ExecuteNonQuery(); + /// } + /// + /// using (SQLiteCommand command = connection.CreateCommand()) + /// { + /// command.CommandText = "SELECT * FROM t1;"; + /// + /// using (SQLiteDataReader dataReader = command.ExecuteReader()) + /// { + /// while (dataReader.Read()) + /// Console.WriteLine(dataReader[0].ToString()); + /// } + /// } + /// + /// connection.Close(); + /// } + /// } + /// } + /// /// public class SQLiteModuleEnumerable : SQLiteModuleNoop /* NOT SEALED */ { #region Private Constants /// @@ -303,11 +342,11 @@ protected virtual SQLiteErrorCode CursorEndOfEnumeratorError( SQLiteVirtualTableCursor cursor ) { SetCursorError(cursor, "already hit end of enumerator"); - return SQLiteErrorCode.Error; + return SQLiteErrorCode.Error; } /////////////////////////////////////////////////////////////////////// ///