本文整理汇总了C#中TableName类的典型用法代码示例。如果您正苦于以下问题:C# TableName类的具体用法?C# TableName怎么用?C# TableName使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TableName类属于命名空间,在下文中一共展示了TableName类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MockTable
public MockTable(TableName name)
{
this.name = name;
columns = new ColumnCollection(this);
rows = new Dictionary<RowId, TableRow>();
rowIndex = new List<RowId>();
}
示例2: Search
public static TableName[] Search(string pattern, TableName[] tableNames)
{
Regex regex = pattern.WildcardRegex();
var result = tableNames.Where(tname => regex.IsMatch(tname.Name)).ToArray();
return result;
}
示例3: CreateTable
public SystemTable CreateTable(TableName tableName)
{
CheckNotDisposed();
// Check the table name given is qualified
CheckTableNameQualified(tableName);
// Does an object with this name already exist in the directory?
ITable tables = GetTable(SystemTableNames.Tables);
IRowCursor ind = GetNames(tables, tableName);
if (ind.Count > 0)
throw new ApplicationException("Table '" + tableName + "' already exists.");
ITable table = state.CreateTable(tableName);
if (table == null)
throw new ApplicationException("The table '" + tableName + "' was not created.");
long tableId = state.CreateUniqueId(SystemTableNames.Tables);
// Construct and create the table
SystemTable sysTable = new SystemTable(this, table, tableId);
// Add this table to the tables.
AddObject(tableId, tableName, "TABLE");
// Log the change in the journal
journal.AddEntry(JournalCommandCode.TableCreate, tableId);
OnChanged();
// Put it in the cache
tableNameMap[tableName] = sysTable;
// And return it
return sysTable;
}
示例4: Register
/// <summary>
/// Register Logee Implement
/// </summary>
/// <param name="tableName"></param>
/// <param name="tableId"></param>
/// <param name="logee"></param>
public void Register(TableName tableName, IRowLogee logee)
{
if (rowLogees.ContainsKey(tableName))
rowLogees.Remove(tableName);
rowLogees.Add(tableName, logee);
}
示例5: TableBase
protected TableBase(TableName tableName)
{
this.tableName = tableName;
columns = new ColumnCollection(this);
DoSetupColumns();
}
示例6: Exporter
public Exporter(PathManager mgr, TreeNode<IDataPath> pt, Configuration cfg)
{
this.mgr = mgr;
this.cfg = cfg;
this.xml = new XmlDbFile { XmlDbFolder = cfg.XmlDbFolder };
this.fileName = cfg.OutputFile;
if (pt.Item is Locator)
{
this.tname = mgr.GetPathFrom<TableName>(pt);
this.dname = tname.DatabaseName;
this.sname = dname.ServerName;
}
else if (pt.Item is TableName)
{
this.tname = (TableName)pt.Item;
this.dname = tname.DatabaseName;
this.sname = dname.ServerName;
}
else if (pt.Item is DatabaseName)
{
this.tname = null;
this.dname = (DatabaseName)pt.Item;
this.sname = dname.ServerName;
}
else if (pt.Item is ServerName)
{
this.tname = null;
this.dname = null;
this.sname = (ServerName)pt.Item;
}
}
示例7: ReadRange
/// <summary>
/// Reads all rows out of multiple local flat-files for the specified date range and table name
/// </summary>
/// <param name="startDay">The start day and time to grab rows from.</param>
/// <param name="endDay">The end day and time to grab rows from.</param>
/// <param name="name">Name of the table to grab data from.</param>
/// <returns>Returns a DataSet that contains all rows that were created inbetween the start and end datetime stamps</returns>
public static DataSet ReadRange(DateTime startDay, DateTime endDay, TableName name)
{
DataTable table;
if (startDay > endDay) {
throw new ArgumentOutOfRangeException("startDay", "startDay cannot be newer than endDay");
}
DataSet set = new DataSet();
if (startDay.Date < endDay.Date) {
table = ReadDay(startDay, name, true);
if (table != null) {
set.Tables.Add(table);
}
startDay = startDay.Date.AddDays(1.0);
}
while (startDay < endDay) {
table = ReadDay(startDay, name, true);
if (table != null) {
set.Tables.Add(table);
}
startDay = startDay.AddDays(1.0);
}
if (startDay.Date == endDay.Date) {
table = ReadDay(endDay, name, false);
if (table != null) {
set.Tables.Add(table);
}
endDay = new DateTime(endDay.Year, endDay.Month, endDay.Day, 0x17, 0x3b, 0x3b);
}
return set;
}
示例8: Difference
public static string Difference(DataProvider from, DataProvider to, string dbNameFrom, string dbNameTo)
{
DatabaseName dname1 = new DatabaseName(from, dbNameFrom);
DatabaseName dname2 = new DatabaseName(to, dbNameTo);
string[] names = MetaDatabase.GetTableNames(dname1);
StringBuilder builder = new StringBuilder();
foreach (string tableName in names)
{
TableName tname1 = new TableName(dname1, tableName);
TableName tname2 = new TableName(dname2, tableName);
string[] primaryKeys = InformationSchema.PrimaryKeySchema(tname1).ToArray<string>(0);
if (primaryKeys.Length == 0)
continue;
if (MetaDatabase.TableExists(tname2))
{
builder.Append(TableCompare.Difference(tname1, tname2, tableName, primaryKeys));
}
else
{
builder.Append(TableCompare.Rows(tableName, from));
}
builder.AppendLine();
}
return builder.ToString();
}
示例9: Includes
public bool Includes(TableName tableName)
{
if (Excludedtables == null)
return true;
return !Excludedtables.IsMatch(tableName.ShortName);
}
示例10: IntegrityRule
internal IntegrityRule(TableName name, TableName tableName, IntegrityRuleKind kind, string[] columnNames)
{
this.name = name;
this.columnNames = columnNames;
this.kind = kind;
this.tableName = tableName;
}
示例11: SqlTableSchema
public static DataTable SqlTableSchema(TableName tableName)
{
DataTable dt1;
string SQL = string.Format(SQL_SCHEMA, "", "WHERE t.name='{0}'");
dt1 = Use(tableName, SQL);
return dt1;
}
示例12: Variable
public Variable(TableName tableName, string columnName)
{
if (tableName == null || columnName == null) {
throw new ArgumentNullException();
}
this.table_name = tableName;
this.column_name = columnName;
}
示例13: Exists
public virtual bool Exists(TableName tname)
{
DatabaseName dname = tname.DatabaseName;
if (!Exists(dname))
return false;
return GetTableNames(dname).FirstOrDefault(row => row.Equals(tname)) != null;
}
示例14: BaseRowAdapter
public BaseRowAdapter(TableName tname, Locator locator)
{
this.columns = new ColumnAdapterCollection();
this.fields = new DataFieldCollection();
this.tableName = tname;
this.locator = locator;
}
示例15: TableWriter
/// <summary>
/// use default locator to save records into database, primary keys must be defined
/// </summary>
/// <param name="tableName"></param>
public TableWriter(TableName tableName)
{
this.schema = tableName.GetTableSchema();
IPrimaryKeys primary = schema.PrimaryKeys;
if (primary.Length != 0)
this.locator = new Locator(primary);
}