public override TableField[] GetFieldMark(string tableName)
        {
            List <TableField> fields = new List <TableField>();

            try
            {
                ADODB.Connection adodb_conn = new ADODB.Connection();
                adodb_conn.Open(base.connector.ConnectionString, null, null, -1);
                ADOX.Catalog catalog = new ADOX.Catalog();
                catalog.ActiveConnection = adodb_conn;
                ADOX.Table table = catalog.Tables[tableName];
                foreach (ADOX.Column col in table.Columns)
                {
                    string type = col.Type.ToString();
                    if (type.Contains('('))
                    {
                        type = type.Substring(type.IndexOf('('));
                    }
                    TableField field = new TableField()
                    {
                        Name   = col.Name,
                        Type   = type,
                        NoNull = false
                    };
                    fields.Add(field);
                }
                Marshal.FinalReleaseComObject(catalog.ActiveConnection);
                Marshal.FinalReleaseComObject(catalog);
                return(fields.ToArray());
            }
            catch (Exception e)
            {
                throw (e);
            }
        }
Beispiel #2
0
 public void UpdateFieldValue(TableField field)
 {
     foreach (TableField tf in TableFields)
     {
         if (tf.Name == field.Name)
         {
             tf.Value = field.Value;
             break;
         }
     }
 }
Beispiel #3
0
 public override void AddField(TableField field)
 {
     foreach (TableField f in TableFields)
     {
         if (f.Name == field.Name)
         {
             f.Value = field.Value;
             return;
         }
     }
     if (CommonFields.Select(f => f.Name).Contains(field.Name))
     {
         field.IsExtend = true;
     }
     TableFields.Add(field);
 }
Beispiel #4
0
 public abstract void AddField(TableField field);
Beispiel #5
0
 public void AddSearchFiled(TableField field)
 {
     SearchFields.Add(field);
 }