本文整理汇总了C#中TableName类的典型用法代码示例。如果您正苦于以下问题:C# TableName类的具体用法?C# TableName怎么用?C# TableName使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TableName类属于命名空间,在下文中一共展示了TableName类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: MockTable
public MockTable(TableName name)
{
this.name = name;
columns = new ColumnCollection(this);
rows = new Dictionary<RowId, TableRow>();
rowIndex = new List<RowId>();
}
开发者ID:ikvm,项目名称:deveelsql,代码行数:7,代码来源:MockTable.cs
示例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;
}
开发者ID:fjiang2,项目名称:sqlcon,代码行数:7,代码来源:MatchedDatabase.cs
示例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;
}
开发者ID:ikvm,项目名称:deveelsql,代码行数:34,代码来源:SystemTransaction_Tables.cs
示例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);
}
开发者ID:fjiang2,项目名称:sqlcon,代码行数:13,代码来源:LogManager.cs
示例5: TableBase
protected TableBase(TableName tableName)
{
this.tableName = tableName;
columns = new ColumnCollection(this);
DoSetupColumns();
}
开发者ID:ikvm,项目名称:deveelsql,代码行数:7,代码来源:TableBase.cs
示例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;
}
}
开发者ID:fjiang2,项目名称:sqlcon,代码行数:31,代码来源:Exporter.cs
示例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;
}
开发者ID:DigenGada,项目名称:lucene-dotnet-api,代码行数:37,代码来源:AnalysisReader.cs
示例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();
}
开发者ID:fjiang2,项目名称:sqlcon,代码行数:31,代码来源:DatabaseCompare.cs
示例9: Includes
public bool Includes(TableName tableName)
{
if (Excludedtables == null)
return true;
return !Excludedtables.IsMatch(tableName.ShortName);
}
开发者ID:fjiang2,项目名称:sqlcon,代码行数:7,代码来源:MatchedDatabase.cs
示例10: IntegrityRule
internal IntegrityRule(TableName name, TableName tableName, IntegrityRuleKind kind, string[] columnNames)
{
this.name = name;
this.columnNames = columnNames;
this.kind = kind;
this.tableName = tableName;
}
开发者ID:ikvm,项目名称:deveelsql,代码行数:7,代码来源:IntegrityRule.cs
示例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;
}
开发者ID:fjiang2,项目名称:sqlcon,代码行数:8,代码来源:InformationSchema.cs
示例12: Variable
public Variable(TableName tableName, string columnName)
{
if (tableName == null || columnName == null) {
throw new ArgumentNullException();
}
this.table_name = tableName;
this.column_name = columnName;
}
开发者ID:ikvm,项目名称:deveelsql,代码行数:8,代码来源:Variable.cs
示例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;
}
开发者ID:fjiang2,项目名称:sqlcon,代码行数:8,代码来源:DbSchemaProvider.cs
示例14: BaseRowAdapter
public BaseRowAdapter(TableName tname, Locator locator)
{
this.columns = new ColumnAdapterCollection();
this.fields = new DataFieldCollection();
this.tableName = tname;
this.locator = locator;
}
开发者ID:fjiang2,项目名称:sqlcon,代码行数:8,代码来源:BaseRowAdapter.cs
示例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);
}
开发者ID:fjiang2,项目名称:sqlcon,代码行数:12,代码来源:TableWriter.cs
示例16: AliasTableNameExpression
public AliasTableNameExpression(Expression child, TableName alias, SqlType returnType)
: base(ExpressionType.AliasTableName)
{
SetArgument("child", child);
SetArgument("alias", alias);
if (returnType != null)
SetArgument("return_type", returnType);
}
开发者ID:ikvm,项目名称:deveelsql,代码行数:8,代码来源:AliasTableNameExpression.cs
示例17: Constraint
public Constraint(TableName tableName, string name, ConstraintType type, string[] columns, bool deferrable, bool deferred)
{
this.tableName = tableName;
this.columns = (string[]) columns.Clone();
this.type = type;
this.name = name;
this.deferrable = deferrable;
this.deferred = deferred;
}
开发者ID:ikvm,项目名称:deveelsql,代码行数:9,代码来源:Constraint.cs
示例18: CompareTable
public string CompareTable(ActionType actiontype, CompareSideType sidetype, TableName tname1, TableName tname2, Dictionary<string, string[]> pk, string[] exceptColumns)
{
TableSchema schema1 = new TableSchema(tname1);
TableSchema schema2 = new TableSchema(tname2);
if (!Exists(tname1))
return string.Empty;
string sql = string.Empty;
if (actiontype == ActionType.CompareSchema)
{
sql = Compare.TableSchemaDifference(sidetype, tname1, tname2);
stdio.WriteLine("completed to {0} table schema {1} => {2}", sidetype, tname1, tname2);
}
else if (actiontype == ActionType.CompareData)
{
if (!Exists(tname2))
{
return string.Empty;
}
if (Compare.TableSchemaDifference(sidetype, tname1, tname2) != string.Empty)
{
stdio.WriteLine("failed to {0} becuase of different table schemas", sidetype);
return string.Empty;
}
bool hasPk = schema1.PrimaryKeys.Length > 0;
sql = Compare.TableDifference(sidetype, schema1, schema2, schema1.PrimaryKeys.Keys, exceptColumns);
if (!hasPk)
{
stdio.WriteLine("warning: no primary key found : {0}", tname1);
string key = tname1.Name.ToUpper();
if (pk.ContainsKey(key))
{
stdio.WriteLine("use predefine keys defined in ini file: {0}", tname1);
sql = Compare.TableDifference(sidetype, schema1, schema2, pk[key], exceptColumns);
}
else
{
stdio.WriteLine("use entire row as primary keys:{0}", tname1);
var keys = schema1.Columns.Select(row => row.ColumnName).ToArray();
sql = Compare.TableDifference(sidetype, schema1, schema2, keys, exceptColumns);
}
}
stdio.WriteLine("completed to {0} table data {1} => {2}", sidetype, tname1, tname2);
}
if (sql != string.Empty && sidetype == CompareSideType.compare)
stdio.WriteLine(sql);
return sql;
}
开发者ID:fjiang2,项目名称:sqlcon,代码行数:57,代码来源:CompareAdapter.cs
示例19: HandleAttributeOverride
public void HandleAttributeOverride()
{
var attrib = Type.GetSingleAttribute<TableAttribute>(false);
if (attrib == null) return;
Table = new TableName(attrib.Name,attrib.DbSchema);
IdentityColumn = attrib.IdentityColumn;
}
开发者ID:sapiens,项目名称:SqlFu,代码行数:9,代码来源:TableInfo.cs
示例20: ForeignKey
public ForeignKey(TableName sourceTable, string[] sourceColumns, TableName refTableName, string[] destColumns,
string updateAction, string deleteAction, bool deferrable, bool deferred)
: base(sourceTable, ConstraintType.ForeignKey, sourceColumns, deferrable, deferred)
{
this.deleteAction = deleteAction;
this.updateAction = updateAction;
this.destColumns = destColumns;
this.refTableName = refTableName;
}
开发者ID:ikvm,项目名称:deveelsql,代码行数:9,代码来源:ForeignKey.cs
注:本文中的TableName类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论