Beispiel #1
0
 public void InitTable()
 {
     DB.CreateTable(TableName, new ColumnDefinition("level", "nvarchar(250)")
                    .AddDefinition(new ColumnDefinition("time", "datetime"))
                    .AddDefinition(new ColumnDefinition("message", "nvarchar(4000)"))
                    );
 }
Beispiel #2
0
        public StreamingEventSource()
        {
            DB      = InitDB();
            Options = InitStreamingOptions();

            DB.CreateTable(TableName, ValueDefs);
            SqlConnection = DB.NewSqlConnection();
            SqlConnection.Open();

            // init the cursor and options
            String dropCursorCmd   = String.Format(@"DEALLOCATE  {0};", CursorName);
            String createCursorCmd = String.Format(@"DECLARE {0}  CURSOR Dynamic Read_Only
                    FOR SELECT * FROM {1} where row_id>={2}
              OPEN {0};", CursorName, TableName, Options.CurrentRow);

            DB.ExecuteNonQuery(createCursorCmd, SqlConnection);

            FetchNextCursorCmd   = String.Format(@"FETCH NEXT FROM {0};", CursorName);
            FetchPriorCursorCmd  = String.Format(@"FETCH PRIOR FROM {0};", CursorName);
            FetchScrollCursorCmd = String.Format(@"FETCH ABSOLUTE {0} FROM {1};", Options.CurrentRow, CursorName);

            ValueNames = ValueDefs.ToList()
                         .Select(def => def.ColumnName).ToArray();



            // skip to the unhappend event
            //while (true)
            //{
            Object[] rs = NextRow();

            if (rs != null)
            {
                if (IsValidRow(rs))
                {
                    //back one
                    PriroRow();
                    //break;
                }
                //else continue; // visited rows
            }
            //    else break;
            //}
        }
Beispiel #3
0
        protected BlobStore(QCDBClient db)
        {
            DB = db;

            DB.CreateTable(TableName, ValueDefs);
        }
Beispiel #4
0
 public void InitTable()
 {
     DB.CreateTable(TableName, ValueDefs);
     //DB.CreateIndex(TableName, "fire_time");
     DB.CreateIndex(TableName, "status");
 }
Beispiel #5
0
 public void InitTable()
 {
     DB = InitDB();
     DB.CreateTable(TableName, ValueDefs);
 }
Beispiel #6
0
 public void InitTable()
 {
     DB.CreateTable(TableName, new ColumnDefinition("name", "nvarchar(250)")
                    .AddDefinition(new ColumnDefinition("value", "nvarchar(250)")));
 }