本文整理汇总了C#中DevInfo.Lib.DI_LibDAL.Connection.DIConnection.DIDataSetDefault方法的典型用法代码示例。如果您正苦于以下问题:C# DIConnection.DIDataSetDefault方法的具体用法?C# DIConnection.DIDataSetDefault怎么用?C# DIConnection.DIDataSetDefault使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DevInfo.Lib.DI_LibDAL.Connection.DIConnection
的用法示例。
在下文中一共展示了DIConnection.DIDataSetDefault方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MergeTextualandNumericDataValueColumn
/// <summary>
/// Rename Data_value and TextualValue column into OrgData_value and OrgTextualValue
/// and merge both column value into new column Data_Value
/// </summary>
/// <param name="dbConnection"></param>
/// <param name="dbQueries"></param>
public static void MergeTextualandNumericDataValueColumn(string databaseFileNameWPath)
{
try
{
using (DIConnection DBConnection = new DIConnection(DIServerType.MsAccess, string.Empty, string.Empty, databaseFileNameWPath, string.Empty, string.Empty))
{
DIQueries DBQueries = new DIQueries(DBConnection.DIDataSetDefault(), DBConnection.DILanguageCodeDefault(DBConnection.DIDataSetDefault()));
MergeTextualandNumericDataValueColumn(DBConnection, DBQueries);
}
}
catch (Exception ex)
{
throw ex;
}
}
示例2: GetDBLanguageCode
/// <summary>
/// Returns the database language code
/// </summary>
/// <param name="dbConnection"></param>
/// <returns></returns>
public static string GetDBLanguageCode(DIConnection dbConnection)
{
string RetVal = string.Empty;
string DataPrefix = dbConnection.DIDataSetDefault();
if (dbConnection.IsValidDILanguage(DataPrefix, DataAdmin.DAAppliationLangCode))
{
RetVal = "_" + DataAdmin.DAAppliationLangCode;
}
else
{
RetVal = dbConnection.DILanguageCodeDefault(DataPrefix);
}
return RetVal;
}
示例3: DatabaseIncrementBuilder
public DatabaseIncrementBuilder(string sourceDBLocation, string TargetDBLocation)
{
string DataPrefix, LangCode = string.Empty;
SourceConnection = new DIConnection(DIServerType.MsAccess, string.Empty, string.Empty, sourceDBLocation, string.Empty, "unitednations2000");
TargetConnection = new DIConnection(DIServerType.MsAccess, string.Empty, string.Empty, TargetDBLocation, string.Empty, "unitednations2000");
DataPrefix = SourceConnection.DIDataSetDefault();
LangCode = SourceConnection.DILanguageCodeDefault(DataPrefix);
SourceQueries = new DIQueries(DataPrefix, LangCode);
DataPrefix = TargetConnection.DIDataSetDefault();
LangCode = TargetConnection.DILanguageCodeDefault(DataPrefix);
TargetQueries = new DIQueries(DataPrefix, LangCode);
this.SourceDbFile = sourceDBLocation;
this.TargetDbFile = TargetDBLocation;
}
示例4: GetDBQueries
/// <summary>
/// Returns the DIQueries object
/// </summary>
/// <param name="dbConnection"></param>
/// <returns></returns>
public static DIQueries GetDBQueries(DIConnection dbConnection)
{
DIQueries RetVal = null;
string LanguageCode = string.Empty;
string DataPrefix = dbConnection.DIDataSetDefault();
if (dbConnection.IsValidDILanguage(DataPrefix, DataAdmin.DAAppliationLangCode))
{
LanguageCode = "_" + DataAdmin.DAAppliationLangCode;
}
else
{
LanguageCode = dbConnection.DILanguageCodeDefault(DataPrefix);
}
RetVal = new DIQueries(DataPrefix, LanguageCode);
return RetVal;
}
示例5: CreateMetadataFromSDMX
public bool CreateMetadataFromSDMX(string templateFileName,string tempFolderPath, string languageCode,string sdmxRegistryUrl)
{
bool RetVal = true;
DIConnection DBConnection = null;
DIQueries DBQueries;
try
{
//create temp template file
DIDatabase TempTemplateFile = new DIDatabase(templateFileName, "UT_", languageCode);
// create database object
DBConnection = new DIConnection(DIServerType.MsAccess, string.Empty, string.Empty, templateFileName, string.Empty, string.Empty);
DBQueries = new DIQueries(DBConnection.DIDataSetDefault(), languageCode);
// delete default categories from blank template
DBConnection.ExecuteNonQuery(DevInfo.Lib.DI_LibDAL.Queries.MetadataCategory.Delete.DeleteMetadataCategory(DBQueries.TablesName.MetadataCategory, string.Empty));
// import data from SDMX
BaseSDMXHelper HelperObj = new BaseSDMXHelper(DBConnection, DBQueries);
string TempXmlFile = tempFolderPath + "\\IMPORT_MSDXML_" + this.GetDateTimeStamp() + DICommon.FileExtension.XML;
HelperObj.GenerateMetadataXMLFromSDMXWebservice(sdmxRegistryUrl, TempXmlFile);
}
catch (Exception ex)
{
RetVal = false;
}
finally
{
// dispose database object
if (DBConnection != null)
{
DBConnection.Dispose();
}
}
return RetVal;
}
示例6: GetMapServerQueries
public static DIQueries GetMapServerQueries(string DataPrefix_UI, string LanguageCode_UI, DIConnection connection)
{
//TO Do GetConnection from web service
DIQueries RetVal = null;
try
{
if (connection.DIDataSets().Select(DBAvailableDatabases.AvlDBPrefix + "='" + DataPrefix_UI.Trim('_') + "'").Length == 0)
{
DataPrefix_UI = connection.DIDataSetDefault();
}
if (connection.DILanguages(DataPrefix_UI).Select(Language.LanguageCode + "='" + LanguageCode_UI + "'").Length == 0)
{
LanguageCode_UI = connection.DILanguageCodeDefault(DataPrefix_UI);
}
RetVal = new DIQueries(DataPrefix_UI, LanguageCode_UI);
}
catch (Exception ex)
{
throw ex;
}
return RetVal;
}
示例7: GetAllDBLangaugeCodesByDbNid
public static DataTable GetAllDBLangaugeCodesByDbNid(int DBNid, DIConnection diConnection)
{
DataTable RetVal = null;
//DIConnection DIConnection;
if (DBNid != 0)
{
//DIConnection = Global.GetDbConnection(DBNid);
RetVal = diConnection.DILanguages(diConnection.DIDataSetDefault());
}
return RetVal;
}
示例8: InsertNewRecords
/// <summary>
/// Insert Newly added records from DES to database
/// </summary>
/// <param name="sDestDBPath">Destination Database Path</param>
/// <param name="MsAccessPwd">Password</param>
/// <param name="sLng_Suffix">Lang suffix</param>
public void InsertNewRecords(String tempDESheetPath, string sDestDBPath, String MsAccessPwd)
{
DataView oDV = null;
DataRowView oDVRow;
string sDB_Prefix;
string sQry = "";
DIConnection DBConnection;
int i;
int j;
int iIndicatorNId = 0;
int iUnitNId = 0;
int[] iSubgroupNId = new int[this.DESheetInformation.Subgroup.Length];
int[] iIUSNId = new int[this.DESheetInformation.Subgroup.Length];
int iSectorNID = 0;
//int[] iClassNId = new int[Strings.Split(this.DESheetInformation.ClassGUID, "{}").Length];
int[] iClassNId = new int[this.DESheetInformation.ClassGUID.Split("{}".ToCharArray()).Length];
int iParentNId;
//Used for Class and Source
bool bNewIUS = false;
Boolean bNewSector = false;
bool bNewClass = false;
//*** True if any of I / U / S is new
bool SectorGlobal = false;
// -- Create New DiConnection with db as sDestDBPath
DBConnection = new DIConnection(DIServerType.MsAccess, "", "", sDestDBPath, "", MsAccessPwd);
//--- Using DAL for getting Database default Prefix
sDB_Prefix = DBConnection.DIDataSetDefault();
String sLng_Suffix = DBConnection.DILanguageCodeDefault(sDB_Prefix);
DIQueries DBQueries = new DIQueries(sDB_Prefix, DBConnection.DILanguageCodeDefault(sDB_Prefix));
// Get SectorNId
iSectorNID = GetSectorNId(DBConnection, DBQueries, out bNewSector, out bNewSector);
//*** If Selected Class has not been inserted by export routine then insert new Class
string[] sClassGuid;
string[] sClassName;
string[] sClassGlobal;
iParentNId = iSectorNID;
//sClassGuid = Strings.Split(this.DESheetInformation.ClassGUID,"{}");
sClassGuid = this.DESheetInformation.ClassGUID.Split("{}".ToCharArray());
sClassName = this.DESheetInformation.ClassName.Split("{}".ToCharArray());
sClassGlobal = this.DESheetInformation.ClassGlobal.Split("{}".ToCharArray());
//*** BugFix 29 Aug 2006 Do not try to insert class into database if indicator is directly associated with sector
if (this.DESheetInformation.ClassGUID != "" & this.DESheetInformation.ClassName != "")
{
for (i = 0; i <= sClassGuid.Length - 1; i++)
{
iClassNId[i] = GetClassNId(DBConnection, DBQueries, out bNewClass, sClassGuid[i].ToString(), SectorGlobal, iParentNId, sClassName[i].ToString());
iParentNId = Convert.ToInt32(iClassNId[i]);
}
}
//*** Indicator_NId
sQry = DBQueries.Indicators.GetIndicator(FilterFieldType.GId, "'" + this.DESheetInformation.IndicatorGUID + "'", FieldSelection.NId);
iIndicatorNId = Convert.ToInt32(DBConnection.ExecuteScalarSqlQuery(sQry));
if (iIndicatorNId == 0)
{
bNewIUS = true;
//-- Getting insert query using DAL
sQry = DI_LibDAL.Queries.Indicator.Insert.InsertIndicator(sDB_Prefix, sLng_Suffix, this.DESheetInformation.Indicator.Replace("'", "''"), this.DESheetInformation.IndicatorGUID, "", false);
//-- Using DAL for query execution and getting identity value
DBConnection.ExecuteNonQuery(sQry);
iIndicatorNId = Convert.ToInt32(DBConnection.ExecuteScalarSqlQuery("SELECT @@IDENTITY"));
}
//*** Unit_NId
//-- Using DAL for getting and executing query for getting unit NId
sQry = DBQueries.Calculates.GetUnitNIdByGId(this.DESheetInformation.UnitGUID);
iUnitNId = Convert.ToInt32(DBConnection.ExecuteScalarSqlQuery(sQry));
if (iUnitNId == 0)
{
bNewIUS = true;
//-- Getting insert query using DAL
sQry = DI_LibDAL.Queries.Unit.Insert.InsertUnit(sDB_Prefix, sLng_Suffix, this.DESheetInformation.Unit.Replace("'", "''"), this.DESheetInformation.UnitGUID, false);
//-- Using DAL for query execution and getting identity value
DBConnection.ExecuteNonQuery(sQry);
iUnitNId = Convert.ToInt32(DBConnection.ExecuteScalarSqlQuery("SELECT @@IDENTITY"));
}
//*** Subgroup_Val_NId
for (i = 0; i <= iSubgroupNId.Length - 1; i++)
{
sQry = DBQueries.Calculates.GetSubgroupValNIdByGId(this.DESheetInformation.SubgroupGUID[i]);
iSubgroupNId[i] = Convert.ToInt32(DBConnection.ExecuteScalarSqlQuery(sQry));
//.........这里部分代码省略.........
示例9: ImportAssistants
internal void ImportAssistants()
{
DIConnection SourceDBConnection = null;
DIQueries SourceDBQueries = null;
string DataPrefix = string.Empty;
string LanguageCode = string.Empty;
//get all source database name
foreach (string SourceFileNameWPath in this.SourceDatabaseFileNamesWPath)
{
//for each source database, import notes
try
{
SourceDBConnection = new DIConnection(new DIConnectionDetails(DIServerType.MsAccess,
string.Empty, string.Empty, SourceFileNameWPath, string.Empty, Common.Constants.DBPassword));
DataPrefix = SourceDBConnection.DIDataSetDefault();
LanguageCode = SourceDBConnection.DILanguageCodeDefault(DataPrefix);
SourceDBQueries = new DIQueries(DataPrefix, LanguageCode);
this.ImportAssistant(SourceDBConnection, SourceDBQueries);
}
catch (Exception)
{
}
finally
{
if (SourceDBConnection != null)
{
SourceDBConnection.Dispose();
this._TargetDBConnection.Dispose();
}
if (SourceDBQueries != null)
{
SourceDBQueries = null;
}
}
}
}
示例10: CreateCacheResults
/// <summary>
/// Create chache results for a language
/// </summary>
/// <param name="dbConnection"></param>
/// <param name="languageCode"></param>
private void CreateCacheResults(DIConnection dbConnection, string languageCode)
{
DITables TableNames;
try
{
//-- Get all tables by dataset and language basis
TableNames = new DITables(dbConnection.DIDataSetDefault(), languageCode);
//-- Create cache table (DI_Search_Results)
this.CreateCacheResultsForDISearchResults(dbConnection, languageCode, TableNames);
//-- Block
this.CreateCacheResultsForBlock(dbConnection, languageCode, TableNames);
//-- Quick Search (level)
this.CreateCacheResultsForLevel(dbConnection, languageCode, TableNames);
}
catch (Exception ex)
{
throw ex;
}
}
示例11: IsDI7Database
/// <summary>
/// check is DI7 database
/// </summary>
/// <returns></returns>
public static bool IsDI7Database(string databaseFileNameWPath)
{
bool RetVal = false;
string DataPrefix = string.Empty;
DIConnection diConnection = new DIConnection(DIServerType.MsAccess, string.Empty, string.Empty, databaseFileNameWPath, string.Empty, "unitednations2000");
DIQueries diQueries;
if (diConnection != null)
{
DataPrefix = diConnection.DIDataSetDefault();
diQueries = new DIQueries(DataPrefix, diConnection.DILanguageCodeDefault(DataPrefix));
if (diConnection.ExecuteDataTable(diQueries.DBVersion.GetRecords(DevInfo.Lib.DI_LibBAL.Converter.Database.Constants.Versions.DI7_0_0_0)).Rows.Count > 0)
{
RetVal = true;
}
}
return RetVal;
}
示例12: ISDevInfoSP2Database
/// <summary>
/// Returns true if template or database is in DevInfo SP2 format
/// </summary>
/// <param name="fileNameWPath"></param>
/// <returns></returns>
/// <remarks>For MsAccess</remarks>
public static bool ISDevInfoSP2Database(string fileNameWPath)
{
bool RetVal = false;
DIConnection DBConnection = null;
DIQueries DBQueries = null;
try
{
DBConnection = new DIConnection(DIServerType.MsAccess, string.Empty, string.Empty, fileNameWPath, string.Empty, string.Empty);
DBQueries = new DIQueries(DBConnection.DIDataSetDefault(), DBConnection.DILanguageCodeDefault(DBConnection.DIDataSetDefault()));
RetVal = DICommon.ISDevInfoSP2Database(DBConnection, DBQueries, false);
}
catch (Exception)
{
RetVal = false;
// Do NOT throw any exception.
}
finally
{
if (DBConnection != null)
{
DBConnection.Dispose();
}
}
return RetVal;
}
示例13: ISDevInfoLatestDatabase
/// <summary>
/// Returns true if template or database is in current DevInfo 6.0 format
/// </summary>
/// <param name="fileNameWPath"></param>
/// <returns></returns>
/// <remarks>For MsAccess</remarks>
public static bool ISDevInfoLatestDatabase(string fileNameWPath, ref string dbFilePostFix)
{
bool RetVal = false;
DIConnection DBConnection = null;
DIQueries DBQueries = null;
DBConverterDecorator DBConverterObject;
DI7_0_0_0DBConverter DI7_DatabaseConvertor;
try
{
DBConnection = new DIConnection(DIServerType.MsAccess, string.Empty, string.Empty, fileNameWPath, string.Empty, string.Empty);
DBQueries = new DIQueries(DBConnection.DIDataSetDefault(), DBConnection.DILanguageCodeDefault(DBConnection.DIDataSetDefault()));
DI7_DatabaseConvertor = new DI7_0_0_0DBConverter(DBConnection, DBQueries);
RetVal = DI7_DatabaseConvertor.IsValidDB(false);
dbFilePostFix = DI7_DatabaseConvertor.DBFilePostfix;
if (RetVal)
{
// if database/tempalte already in DI7 format then convert it into latest format
DBConverterObject = new DBConverterDecorator(DBConnection, DBQueries);
DBConverterObject.DoConversion(false);
}
}
catch (Exception)
{
RetVal = false;
// Do NOT throw any exception.
}
finally
{
if (DBConnection != null)
{
DBConnection.Dispose();
}
}
return RetVal;
}
示例14: GetQDSSubgroupDetails
public DataTable GetQDSSubgroupDetails(DIConnection dbConnection, string languageCode)
{
DataTable RetVal = null;
StringBuilder SBQry = new StringBuilder();
string StrQry = string.Empty;
DITables TableNames;
try
{
//-- Get table names for current dataset and language
TableNames = new DITables(dbConnection.DIDataSetDefault(), languageCode);
//-- Get QDSSubgroupDetailsTable
SBQry.Append("SELECT SVS." + SubgroupValsSubgroup.SubgroupValNId + ", sdv." + Subgroup.SubgroupName + " AS DimensionValue, SD." + SubgroupTypes.SubgroupTypeName + " AS Dimension,");
SBQry.Append(" SD." + SubgroupTypes.SubgroupTypeNId + " AS DimensionNId");
SBQry.Append(" FROM " + TableNames.SubgroupType + " AS SD INNER JOIN (" + TableNames.Subgroup + " AS SDV INNER JOIN "+ TableNames.SubgroupValsSubgroup +" AS SVS");
SBQry.Append(" ON SDV." + Subgroup.SubgroupNId + " = SVS." + SubgroupValsSubgroup.SubgroupNId + ") ON SD." + SubgroupTypes.SubgroupTypeNId + " = SDV." + Subgroup.SubgroupType);
StrQry = SBQry.ToString();
RetVal = dbConnection.ExecuteDataTable(StrQry);
}
catch (Exception)
{
throw;
}
return RetVal;
}
示例15: GetQDSResults
public DataSet GetQDSResults(DIConnection dbConnection, string searchIndicators, string searchICs, string searchAreas, string searchLanguage, bool isBlockResults)
{
DataSet RetVal = new DataSet();
string CatalogAdaptationUrl = string.Empty;
DataTable DtQDSResults = new DataTable();
DataTable DtQDSChildResults = new DataTable();
string NumericSearchAreas = string.Empty;
string QSSearchAreas = string.Empty;
DITables TableNames;
try
{
//-- Get all tables by dataset and language basis
TableNames = new DITables(dbConnection.DIDataSetDefault(), searchLanguage);
if (string.IsNullOrEmpty(searchAreas))
{
string[] DefaultAreaArr = this.GetDefaultAreasArr(dbConnection, TableNames);
if (DefaultAreaArr.Length > 0)
{
searchAreas = DefaultAreaArr[0];
}
}
#region "-- Seperate Normal and QS areas --"
//-- Seperate Numric and QS area in variable
foreach (string SptText in DICommon.SplitString(searchAreas, ","))
{
if (DICommon.IsNumeric(SptText))
{
NumericSearchAreas += "," + SptText;
}
else
{
QSSearchAreas += "," + SptText;
}
}
if (!string.IsNullOrEmpty(NumericSearchAreas))
{
searchAreas = NumericSearchAreas.Substring(1);
}
else
{
searchAreas = string.Empty;
}
if (!string.IsNullOrEmpty(QSSearchAreas))
{
QSSearchAreas = QSSearchAreas.Substring(1);
}
#endregion
if (string.IsNullOrEmpty(searchIndicators))
{
string[] DefaultIndArr = this.GetDefaultIndicatorsArr(dbConnection, TableNames);
if (DefaultIndArr.Length > 0)
{
searchIndicators = DefaultIndArr[0];
}
}
else
{
#region "-- Seperate indicator and IC --"
string IndNIds = string.Empty;
//-- Seperate Numric and QS area in variable
foreach (string SptText in DICommon.SplitString(searchIndicators, ","))
{
if (SptText.IndexOf("ic_") > -1)
{
IndNIds += "," + DI7OfflineSPHelper.GetIndicatorNIdsFromICNId(dbConnection, TableNames, Convert.ToInt32(SptText.Substring(3)));
}
else
{
IndNIds += "," + SptText;
}
}
if (!string.IsNullOrEmpty(IndNIds))
{
searchIndicators = IndNIds.Substring(1);
}
#endregion
}
#region "-- Get Parent Data --"
//-- Create an empty Parent Table, TmpSearchAreaa, TmpSearchIndicators
CacheUtility.CreateParentTbl(dbConnection, searchLanguage);
DI7OfflineSPHelper.CreateTmpAreaSearchTbl(dbConnection, searchAreas, false);
DI7OfflineSPHelper.CreateTmpIndSearchTbl(dbConnection, TableNames, searchIndicators, false);
//-- Get Record for Normal areas
if (!string.IsNullOrEmpty(searchAreas))
{
//.........这里部分代码省略.........