本文整理汇总了C#中TableName.Exists方法的典型用法代码示例。如果您正苦于以下问题:C# TableName.Exists方法的具体用法?C# TableName.Exists怎么用?C# TableName.Exists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TableName
的用法示例。
在下文中一共展示了TableName.Exists方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DatabaseDifference
public static string DatabaseDifference(CompareSideType sideType, DatabaseName dname1, DatabaseName dname2, string[] excludedTables)
{
TableName[] names = dname1.GetDependencyTableNames();
excludedTables = excludedTables.Select(row => row.ToUpper()).ToArray();
StringBuilder builder = new StringBuilder();
foreach (TableName tableName in names)
{
TableName tname1 = tableName;
TableName tname2 = new TableName(dname2, tableName.SchemaName, tableName.Name);
TableSchema schema1 = new TableSchema(tname1);
TableSchema schema2 = new TableSchema(tname2);
Console.WriteLine(tname1.ShortName);
if (excludedTables.Contains(tableName.ShortName.ToUpper()))
{
Console.WriteLine("skip to compare data on excluded table {0}", tableName.ShortName);
continue;
}
if (schema1.PrimaryKeys.Length == 0)
{
Console.WriteLine("undefined primary key");
continue;
}
if (tname2.Exists())
{
builder.Append(TableDifference(sideType, schema1, schema2, schema1.PrimaryKeys.Keys, new string[] { }));
}
else
{
builder.Append(Compare.GenerateRows(schema1, new TableReader(tname1)));
}
builder.AppendLine();
}
return builder.ToString();
}
示例2: Exists
private static bool Exists(TableName tname)
{
if (!tname.Exists())
{
stdio.WriteLine("table not found : {0}", tname);
return false;
}
return true;
}
示例3: TableSchemaDifference
public static string TableSchemaDifference(CompareSideType sideType, TableName tableName1, TableName tableName2)
{
string sql;
if (tableName2.Exists())
{
TableSchemaCompare compare = new TableSchemaCompare(tableName1, tableName2) { SideType = sideType };
sql = compare.Compare();
}
else
{
sql = tableName1.GenerateCluase();
}
return sql;
}