示例#1
0
 public void PopulateCombo(ComboBox combo, TPCIndexField[] keys, int offsetkeys, int noKeys)
 {
     combo.Items.Clear();
       if (cursor.HasReader())
       {
     dataTableGrid.Table.Load(cursor.Reader);
     System.Data.DataRowCollection rows = dataTableGrid.Table.Rows;
     for (int r = 0; r < rows.Count; r++)
     {
       string text = "";
       string w = "";
       for (int i = 0; i < noKeys; i++)
       {
     int c = keys[i + offsetkeys].index;
     text += w + rows[r][c];
     w = "|";
       }
       combo.Items.Add(text);
     }
       }
 }
示例#2
0
 public void GetTable(string tableName, TPCField[] allFields, int offsetFields, int noFields, TPCIndexField[] orderFields, int offsetOrderFields, int noOrderFields)
 {
     string query = "SELECT";
       string comma = " ";
       fields = new TPCField[noFields];
       for (int i=0; i<noFields; i++)
       {
     fields[i] = allFields[offsetFields + i];
     query += comma + fields[i].name;
     comma = ", ";
       }
       dataTableGrid = new DataTableGrid(tableName);
       dataTableGrid.MakeTableColumns(fields);
       query += comma + UsId + ", " + TmStamp + " FROM " + tableName;
       if (Lookup.Length > 0)
     query += " " + Lookup;
       else
     query += " WHERE ROWNUM <= 1000";
       if (noOrderFields > 0)
       {
     string orderBy = " ORDER BY";
     comma = " ";
     for (int i = 0; i < noOrderFields; i++)
     {
       int no = orderFields[offsetOrderFields + i].index;
       TPCField field = fields[no];
       orderBy += comma + field.name;
       comma = ", ";
     }
     query += orderBy;
       }
       cursor.Format(query, 0);
       if (ShowSQL)
     LogDebug = query;
       cursor.Run();
 }