本文整理汇总了C#中DevInfo.Lib.DI_LibDAL.Connection.DIConnection.DropTable方法的典型用法代码示例。如果您正苦于以下问题:C# DIConnection.DropTable方法的具体用法?C# DIConnection.DropTable怎么用?C# DIConnection.DropTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DevInfo.Lib.DI_LibDAL.Connection.DIConnection
的用法示例。
在下文中一共展示了DIConnection.DropTable方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateDISearchResultsTable
public static int CreateDISearchResultsTable(DIConnection dbConnection, string languageCode)
{
int RetVal = -1;
StringBuilder SBQry = new StringBuilder();
string TblName = string.Empty;
try
{
TblName = QDSConstants.QDSTables.DISearchResult.TableName + "_" + languageCode;
dbConnection.DropTable(TblName);
SBQry.Append("Create Table " + TblName);
SBQry.Append("(");
SBQry.Append("[" + QDSConstants.QDSTables.DISearchResult.Columns.NId + "] COUNTER, ");
SBQry.Append("[" + QDSConstants.QDSTables.DISearchResult.Columns.SearchLanguage + "] Text(50) NOT NULL, ");
SBQry.Append("[" + QDSConstants.QDSTables.DISearchResult.Columns.IndicatorNId + "] Long NULL, ");
SBQry.Append("[" + QDSConstants.QDSTables.DISearchResult.Columns.UnitNId + "] Long NULL, ");
SBQry.Append("[" + QDSConstants.QDSTables.DISearchResult.Columns.AreaNId + "] Long NULL, ");
SBQry.Append("[" + QDSConstants.QDSTables.DISearchResult.Columns.IsAreaNumeric + "] YESNO NOT NULL, ");
SBQry.Append("[" + QDSConstants.QDSTables.DISearchResult.Columns.IndicatorName + "] Text(255) NOT NULL, ");
SBQry.Append("[" + QDSConstants.QDSTables.DISearchResult.Columns.Unit + "] Text(128) NOT NULL, ");
SBQry.Append("[" + QDSConstants.QDSTables.DISearchResult.Columns.Area + "] Text(255) NULL, ");
SBQry.Append("[" + QDSConstants.QDSTables.DISearchResult.Columns.DefaultSG + "] Text(255) NULL, ");
SBQry.Append("[" + QDSConstants.QDSTables.DISearchResult.Columns.MRDTP + "] Text NULL, ");
SBQry.Append("[" + QDSConstants.QDSTables.DISearchResult.Columns.MRD + "] Text NULL, ");
SBQry.Append("[" + QDSConstants.QDSTables.DISearchResult.Columns.AreaCount + "] Long NULL, ");
SBQry.Append("[" + QDSConstants.QDSTables.DISearchResult.Columns.SGCount + "] Long NULL, ");
SBQry.Append("[" + QDSConstants.QDSTables.DISearchResult.Columns.SourceCount + "] Long NULL, ");
SBQry.Append("[" + QDSConstants.QDSTables.DISearchResult.Columns.TPCount + "] Long NULL, ");
SBQry.Append("[" + QDSConstants.QDSTables.DISearchResult.Columns.DVCount + "] Long NULL, ");
SBQry.Append("[" + QDSConstants.QDSTables.DISearchResult.Columns.AreaNIds + "] Text(255) NULL, ");
SBQry.Append("[" + QDSConstants.QDSTables.DISearchResult.Columns.SGNIds + "] Text NULL, ");
SBQry.Append("[" + QDSConstants.QDSTables.DISearchResult.Columns.SourceNIds + "] Text NULL, ");
SBQry.Append("[" + QDSConstants.QDSTables.DISearchResult.Columns.TPNIds + "] Text NULL, ");
SBQry.Append("[" + QDSConstants.QDSTables.DISearchResult.Columns.DVNIds + "] Text NULL, ");
SBQry.Append("[" + QDSConstants.QDSTables.DISearchResult.Columns.DVSeries + "] Text NULL, ");
SBQry.Append("[" + QDSConstants.QDSTables.DISearchResult.Columns.Dimensions + "] Text NULL, ");
SBQry.Append("[" + QDSConstants.QDSTables.DISearchResult.Columns.BlockAreaParentNId + "] Long NULL, ");
SBQry.Append("[" + QDSConstants.QDSTables.DISearchResult.Columns.IUSNId + "] Long NULL, ");
SBQry.Append("[" + QDSConstants.QDSTables.DISearchResult.Columns.AreaParentNId + "] Long NULL, ");
SBQry.Append("[" + QDSConstants.QDSTables.DISearchResult.Columns.IsBlockAreaRecord + "] YESNO");
SBQry.Append(")");
RetVal = dbConnection.ExecuteNonQuery(SBQry.ToString());
}
catch (Exception)
{
throw;
}
return RetVal;
}
示例2: CreateSearchResultCopyTable
/// <summary>
/// Create new table schema of DI_Search_Result table
/// </summary>
/// <param name="dbConnection"></param>
/// <param name="tableName"></param>
/// <param name="languageCode"></param>
/// <returns></returns>
private static int CreateSearchResultCopyTable(DIConnection dbConnection, string tableName, string languageCode)
{
int RetVal = -1;
StringBuilder SBQry = new StringBuilder();
string StrQry = string.Empty;
try
{
dbConnection.DropTable(tableName);
SBQry.Remove(0, SBQry.Length);
SBQry.Append("SELECT * INTO " + tableName);
SBQry.Append(" FROM " + QDSConstants.QDSTables.DISearchResult.TableName + "_" + languageCode);
SBQry.Append(" WHERE 1=2");
StrQry = SBQry.ToString();
RetVal = dbConnection.ExecuteNonQuery(StrQry);
}
catch (Exception)
{
}
return RetVal;
}
示例3: CreateTempMRDRecordsTable
public static int CreateTempMRDRecordsTable(DIConnection dbConnection)
{
int RetVal = -1;
StringBuilder SBQry = new StringBuilder();
string TblName = string.Empty;
try
{
TblName = QDSConstants.QDSTables.TempMRDRecords.TableName;
dbConnection.DropTable(TblName);
SBQry.Append("Create Table " + TblName);
SBQry.Append("(");
SBQry.Append("[" + QDSConstants.QDSTables.TempMRDRecords.Columns.IUSNId + "] Long NULL, ");
SBQry.Append("[" + QDSConstants.QDSTables.TempMRDRecords.Columns.IndicatorNId + "] Long NULL, ");
SBQry.Append("[" + QDSConstants.QDSTables.TempMRDRecords.Columns.UnitNId + "] Long NULL, ");
SBQry.Append("[" + QDSConstants.QDSTables.TempMRDRecords.Columns.SubgroupValNId + "] Long NULL, ");
SBQry.Append("[" + QDSConstants.QDSTables.TempMRDRecords.Columns.AreaNId + "] Long NULL, ");
SBQry.Append("[" + QDSConstants.QDSTables.TempMRDRecords.Columns.Timeperiod + "] Text(255) NULL, ");
SBQry.Append("[" + QDSConstants.QDSTables.TempMRDRecords.Columns.DVCount + "] Long NULL, ");
SBQry.Append("[" + QDSConstants.QDSTables.TempMRDRecords.Columns.DV + "] Text(255) NULL ");
SBQry.Append(")");
RetVal = dbConnection.ExecuteNonQuery(SBQry.ToString());
}
catch (Exception)
{
throw;
}
return RetVal;
}
示例4: CreateSplittedListTable
public static int CreateSplittedListTable(DIConnection dbConnection, bool isNumericValues)
{
int RetVal = -1;
StringBuilder SBQry = new StringBuilder();
string TblName = string.Empty;
string ColumnDataType = "Text(255)";
try
{
TblName = QDSConstants.QDSTables.SplittedList.TableName;
dbConnection.DropTable(TblName);
if (isNumericValues)
{
ColumnDataType = "Long";
}
SBQry.Append("Create Table " + TblName);
SBQry.Append("(");
SBQry.Append("[" + QDSConstants.QDSTables.SplittedList.Columns.Value + "] " + ColumnDataType);
SBQry.Append(")");
RetVal = dbConnection.ExecuteNonQuery(SBQry.ToString());
}
catch (Exception)
{
throw;
}
return RetVal;
}
示例5: CreateSearchIndicatorsTable1
public static int CreateSearchIndicatorsTable1(DIConnection dbConnection)
{
int RetVal = -1;
StringBuilder SBQry = new StringBuilder();
string TblName = string.Empty;
try
{
TblName = QDSConstants.QDSTables.SearchIndicators.TableName;
dbConnection.DropTable(TblName);
SBQry.Append("Create Table " + TblName);
SBQry.Append("(");
SBQry.Append("[" + QDSConstants.QDSTables.SearchIndicators.Columns.Id + "] COUNTER CONSTRAINT PKey PRIMARY KEY, ");
SBQry.Append("[" + QDSConstants.QDSTables.SearchIndicators.Columns.IndicatorNId + "] Long DEFAULT 0, ");
SBQry.Append("[" + QDSConstants.QDSTables.SearchIndicators.Columns.IndicatorName + "] Varchar(255) DEFAULT '' NOT NULL , ");
SBQry.Append("[" + QDSConstants.QDSTables.SearchIndicators.Columns.ICName + "] Varchar DEFAULT '' NOT NULL ");
SBQry.Append(")");
RetVal = dbConnection.ExecuteNonQuery(SBQry.ToString());
}
catch (Exception)
{
throw;
}
return RetVal;
}
示例6: CreateSearchIndicatorsTable
public static int CreateSearchIndicatorsTable(DIConnection dbConnection)
{
int RetVal = -1;
StringBuilder SBQry = new StringBuilder();
string TblName = string.Empty;
try
{
TblName = QDSConstants.QDSTables.SearchIndicators.TableName;
dbConnection.DropTable(TblName);
SBQry.Append("Create Table " + TblName);
SBQry.Append("(");
SBQry.Append("[" + QDSConstants.QDSTables.SearchIndicators.Columns.IndicatorNId + "] Long");
SBQry.Append(")");
RetVal = dbConnection.ExecuteNonQuery(SBQry.ToString());
}
catch (Exception)
{
throw;
}
return RetVal;
}
示例7: CreateLinkTableForAccessDB
/// <summary>
/// Copies the given sourceTable from SourceDatabase into TargetDatabase
/// </summary>
public static void CreateLinkTableForAccessDB(string targetDatabase, string sourceDatabase, string targetTable, string sourceTable)
{
// Create another connection to read SourceDataBase.
OleDbConnection Connection;
OleDbCommand Command;
string SqlString = string.Empty;
DIConnection TargetDBConnection = null;
try
{
string ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data source=" + sourceDatabase + ";Jet OLEDB:Database Password=" + DIConnectionDetails.MSAccessDefaultPassword + ";Persist Security Info=False;";
Connection = new OleDbConnection(ConnectionString);
Command = new OleDbCommand();
Command.Connection = Connection;
Connection.Open();
// 1. Drop target table if already exits
// 1.1 Connect to target database
try
{
TargetDBConnection = new DIConnection(DIServerType.MsAccess, string.Empty, string.Empty, targetDatabase, string.Empty, string.Empty);
TargetDBConnection.DropTable(targetTable);
}
catch (Exception)
{
}
finally
{
// 1.2 Dispose connection
if (TargetDBConnection != null)
{
TargetDBConnection.Dispose();
}
}
// 2. Insert Source table into targetDatabase.targetTable
SqlString = "INSERT INTO [MS Access;Database=" + targetDatabase + ";pwd=" + DIConnectionDetails.MSAccessDefaultPassword + ";].[" + targetTable + "]" +
" SELECT * FROM " + sourceTable;
Command.CommandText = SqlString;
Command.ExecuteNonQuery();
Connection.Close();
}
catch (Exception ex)
{
ExceptionFacade.ThrowException(ex);
}
}