public override Task<DbDataReader> __DbCommand_ExecuteReaderAsync()
        {
            Console.WriteLine("enter __DbCommand_ExecuteReaderAsync " + new { CommandText });

            var x = new TaskCompletionSource<DbDataReader>();

            // X:\jsc.svn\examples\javascript\Test\TestWebSQLDatabase\TestWebSQLDatabase\Application.cs

            this.InternalConnection.db.transaction(
                callback:
                     tx =>
                     {
                         tx.executeSql(
                             sqlStatement: this.CommandText,

                             callback:
                                   (SQLTransaction xtx, SQLResultSet r) =>
                                   {
                                       this.InternalConnection.InternalLastSQLResultSet = null;

                                       __DbDataReader xx = new __SQLiteDataReader { r = r };

                                       x.SetResult(xx);
                                   },

                            errorCallback:
                                 (SQLTransaction transaction, SQLError error) =>
                                 {
                                     Console.WriteLine("executeSql error __DbCommand_ExecuteReaderAsync " + new { error.message, error.code });

                                 }

                         );

                     },


                     errorCallback:
                         (SQLError error) =>
                         {
                             Console.WriteLine("transaction error __DbCommand_ExecuteReaderAsync " + new { error.message, error.code });

                         }

            );

            return x.Task;
        }
Beispiel #2
0
        public override Task <DbDataReader> __DbCommand_ExecuteReaderAsync()
        {
            Console.WriteLine("enter __DbCommand_ExecuteReaderAsync " + new { CommandText });

            var x = new TaskCompletionSource <DbDataReader>();

            // X:\jsc.svn\examples\javascript\Test\TestWebSQLDatabase\TestWebSQLDatabase\Application.cs

            this.InternalConnection.db.transaction(
                callback:
                tx =>
            {
                tx.executeSql(
                    sqlStatement: this.CommandText,

                    callback:
                    (SQLTransaction xtx, SQLResultSet r) =>
                {
                    this.InternalConnection.InternalLastSQLResultSet = null;

                    __DbDataReader xx = new __SQLiteDataReader {
                        r = r
                    };

                    x.SetResult(xx);
                },

                    errorCallback:
                    (SQLTransaction transaction, SQLError error) =>
                {
                    Console.WriteLine("executeSql error __DbCommand_ExecuteReaderAsync " + new { error.message, error.code });
                }

                    );
            },


                errorCallback:
                (SQLError error) =>
            {
                Console.WriteLine("transaction error __DbCommand_ExecuteReaderAsync " + new { error.message, error.code });
            }

                );

            return(x.Task);
        }