Esempio n. 1
0
        private string PrintAllTableInfo(TransferRule aTr)
        {
            StringBuilder retVal = new StringBuilder();

            retVal.AppendLine(SqlCommandRunner.GetTableInfo(aTr.DbsToTransfer[0].TablesToTransfer[0].TableName, _TempDbName));
            retVal.AppendLine(SqlCommandRunner.GetTableInfo(aTr.DbsToTransfer[0].ProtectTableNames[0], _TempDbName));
            retVal.AppendLine(SqlCommandRunner.GetTableInfo(aTr.DbsToTransfer[0].ProtectTableNames[1], _TempDbName));
            return(retVal.ToString());
        }
Esempio n. 2
0
        public void Test2()
        {
            //删除数据库1的一个表
            SqlCommandRunner.DropTable(_MainTableName, _TempOtherDbName);
            //表没有了,表信息就没有办法打印出来
            try
            {
                Console.WriteLine(SqlCommandRunner.GetTableInfo(_MainTableName, _TempOtherDbName));
                Assert.Fail();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }

            //拷贝数据库的表过来作为替换
            SqlCommandRunner.CopyTable(_MainTableName, _TempDbName, _TempOtherDbName);
            Console.WriteLine(SqlCommandRunner.GetTableInfo(_MainTableName, _TempOtherDbName));
        }