本文整理汇总了C#中DbmsType类的典型用法代码示例。如果您正苦于以下问题:C# DbmsType类的具体用法?C# DbmsType怎么用?C# DbmsType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DbmsType类属于命名空间,在下文中一共展示了DbmsType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ConnectInfo
public ConnectInfo()
{
this.Text="������";
this.Dbmstype=DbmsType.Oledb;
this.Uid=Guid.NewGuid().ToString();
this.driver="SQLOLEDB";
}
开发者ID:EdgarEDT,项目名称:myitoppsp,代码行数:7,代码来源:ConnectInfo.cs
示例2: RenderInsert
/// <summary>
/// Renders INSERT statement.
/// </summary>
/// <param name="insert">INSERT statement that is being rendered.</param>
/// <param name="nextSequence">Ignored. SQLite doesn't use sequences.</param>
/// <param name="dbms">Target DBMS. Different auto-id retrieval for SQL 7.0 then in newer versions.</param>
/// <param name="output">StringBuilder to which the SQL code is appended.</param>
/// <param name="parameters">SQL parameter collection to which the object's and its children's
/// parameters are added. After the rendering is done the collection contains all parameters with unique names.</param>
/// <returns><b>null</b> because automatically generated ID must be fetched via SELECT after INSERT.</returns>
public DbParameter RenderInsert(InsertStatement insert, DbParameter nextSequence, DbmsType dbms, StringBuilder output, DbParameterCollection parameters)
{
// Renders INSERT statements for DBMSs that support an auto-identity fields.
// Auto-id field may or may not be in the column-value list.
// If auto-incremented field is in the column-value list it will be skipped.
// Table may have only one auto-identity field.
// Method expects that all errors have been identified and processed in the caller.
// Renders all fields except auto-id field; thus -1 if auto-id is contained in the column-value list.
int numberOfFieldsToRender = GetTotalNumberOfFieldsToRender(insert);
AppendInsertIntoTableName(insert, dbms, output);
if (numberOfFieldsToRender > 0)
{
AppendBracketsWithAllFieldsExceptAutoId(insert, dbms, output, numberOfFieldsToRender);
AppendValuesForAllFieldsExceptAutoId(insert, dbms, output, parameters, numberOfFieldsToRender);
}
else
{
AppendDefaultValuesExpression(output);
}
// Auto ID must be fetched via SELECT after INSERT.
DbParameter autoId = null;
return autoId;
}
开发者ID:lordfist,项目名称:FistCore.Lib,代码行数:35,代码来源:SQLiteInserter.cs
示例3: RenderSingleQuery
private static void RenderSingleQuery(SelectStatement select, DbmsType dbms, StringBuilder output, DbParameterCollection parameters)
{
// Either TOP or ORDER BY is used; but not both.
// SELECT ... FROM ...
// WHERE (ROWNUM <= @top) AND (@this.filter)
// GROUP BY ... HAVING ... ORDER BY ...
AppendSelectAndDistinctKeyWords(select, output);
AppendSelectList(select, dbms, output, parameters);
AppendFromClause(select, dbms, output);
// WHERE. We have made sure that if TOP is used then ORDER BY is not used.
if (select.Top > 0)
{
// WHERE ROWNUM <= this.top AND (this.filter).
output.Append(" WHERE ROWNUM <= " + select.Top.ToString(CultureInfo.InvariantCulture));
if (select.Where != null && !select.Where.IsEmpty)
{
output.Append(" AND (");
select.Where.Render(dbms, output, parameters);
output.Append(")");
}
}
else
{
AppenWhereWoRownum(select, dbms, output, parameters);
}
AppendGroupByClause(select, dbms, output, parameters);
AppendHavingClause(select, dbms, output, parameters);
AppendOrderByClause(select, dbms, output, parameters);
}
开发者ID:lordfist,项目名称:FistCore.Lib,代码行数:33,代码来源:OracleSelectRenderer.cs
示例4: RenderInsert
/// <summary>
/// Renders INSERT statement and code that retrieves the new ID.
/// </summary>
/// <param name="insert">INSERT statement that is being rendered.</param>
/// <param name="nextSequence">Ignored. SQL Server doesn't use sequences.</param>
/// <param name="dbms">Target DBMS. Different auto-id retrieval for SQL 7.0 then in newer versions.</param>
/// <param name="output">StringBuilder to which the SQL code is appended.</param>
/// <param name="parameters">SQL parameter collection to which the object's and its children's
/// parameters are added. After the rendering is done the collection contains all parameters with unique names.</param>
/// <returns>Ouput parameter that will contain the value retrieved by RETURNING clause.</returns>
public DbParameter RenderInsert(InsertStatement insert, DbParameter nextSequence, DbmsType dbms, StringBuilder output, DbParameterCollection parameters)
{
// Renders INSERT statements for DBMSs that support an auto-identity fields.
// Auto-id field may or may not be in the column-value list.
// If auto-incremented field is in the column-value list it will be skipped.
// Table may have only one auto-identity field.
// Method expects that all errors have been identified and processed in the caller.
// Renders all fields except auto-id field; thus -1 if auto-id is contained in the column-value list.
int numberOfFieldsToRender = GetTotalNumberOfFieldsToRender(insert);
AppendInsertIntoTableName(insert, dbms, output);
if (numberOfFieldsToRender > 0)
{
AppendBracketsWithAllFieldsExceptAutoId(insert, dbms, output, numberOfFieldsToRender);
AppendValuesForAllFieldsExceptAutoId(insert, dbms, output, parameters, numberOfFieldsToRender);
}
else
{
AppendDefaultValuesExpression(output);
}
IDbColumn autoIdField = GetAutoIdField(insert.Table);
DbParameter autoId = null;
if (autoIdField != null)
{
// RETURNING id
output.Append(" RETURNING ");
autoIdField.RenderColumnName(dbms, output);
autoId = new DbParameter("?", DbType.Int32) { Direction = ParameterDirection.Output };
parameters.Add(autoId);
}
// Return auto-id DB parameter. Callers require it to retrieve the new ID value.
return autoId;
}
开发者ID:lordfist,项目名称:FistCore.Lib,代码行数:45,代码来源:FirebirdInserter.cs
示例5: Execute
/// <summary>Executes <see cref="UpdateStatement"/>. Bulk updates are executed in multiple round trips - one update at a time.</summary>
public int Execute(UpdateStatement update, DbmsType dbms, IConnectionProvider conn, out CommandExecutionStatistics lastExecutedCommandInfo, int cmdTimeout = 30)
{
if (IsBulkUpdate(update))
return ExecuteBulkUpdate(update, dbms, conn, out lastExecutedCommandInfo, cmdTimeout);
else
return ExecuteSingleTableUpdate(update, dbms, conn, out lastExecutedCommandInfo, cmdTimeout);
}
开发者ID:lordfist,项目名称:FistCore.Lib,代码行数:8,代码来源:GenericUpdater.cs
示例6: AppendRelations
private static void AppendRelations(UpdateStatement update, DbmsType dbms, StringBuilder output)
{
if (update.Relations != null && update.Relations.Count > 0)
{
output.Append(" ");
update.Relations.RenderFromClause(update.Table, dbms, output);
}
}
开发者ID:lordfist,项目名称:FistCore.Lib,代码行数:8,代码来源:SqlServerUpdater.cs
示例7: AppendSelectList
private static void AppendSelectList(SelectStatement select, DbmsType dbms, StringBuilder output, DbParameterCollection parameters)
{
// Select list.
if (select.SelectList != null && select.SelectList.Count > 0)
select.SelectList.Render(dbms, output, parameters);
else
output.Append("*");
}
开发者ID:lordfist,项目名称:FistCore.Lib,代码行数:8,代码来源:SqlServerSelectRenderer.cs
示例8: AppendWhereClause
private static void AppendWhereClause(SelectStatement select, DbmsType dbms, StringBuilder output, DbParameterCollection parameters)
{
// WHERE.
if (select.Where != null && !select.Where.IsEmpty)
{
output.Append(" WHERE ");
select.Where.Render(dbms, output, parameters);
}
}
开发者ID:lordfist,项目名称:FistCore.Lib,代码行数:9,代码来源:SqlServerSelectRenderer.cs
示例9: AppendWhere
private static void AppendWhere(SearchCondition where, DbmsType dbms, StringBuilder output, DbParameterCollection parameters)
{
bool hasFilter = (where != null) && !where.IsEmpty;
if (hasFilter)
{
output.Append(" WHERE ");
where.Render(dbms, output, parameters);
}
}
开发者ID:lordfist,项目名称:FistCore.Lib,代码行数:9,代码来源:GenericUpdater.cs
示例10: Catalog
static Catalog()
{
string cfgDbmsType = ConfigurationManager.AppSettings["AdventureWorks.DbmsType"];
if (cfgDbmsType != null)
dbmsType = (DbmsType)Enum.Parse(typeof(DbmsType), cfgDbmsType);
if ((ConfigurationManager.ConnectionStrings != null) && (ConfigurationManager.ConnectionStrings["AdventureWorks.ConnectionString"] != null))
connectionString = ConfigurationManager.ConnectionStrings["AdventureWorks.ConnectionString"].ConnectionString;
}
开发者ID:lordfist,项目名称:FistCore.Lib,代码行数:9,代码来源:AdventureWorks.DAL.cs
示例11: AppendHavingClause
private static void AppendHavingClause(SelectStatement select, DbmsType dbms, StringBuilder output, DbParameterCollection parameters)
{
// HAVING.
if (select.Having != null && !select.Having.IsEmpty)
{
output.Append(" HAVING ");
select.Having.Render(dbms, output, parameters);
}
}
开发者ID:lordfist,项目名称:FistCore.Lib,代码行数:9,代码来源:GenericSelectRenderer.cs
示例12: AppendGroupByClause
private static void AppendGroupByClause(SelectStatement select, DbmsType dbms, StringBuilder output, DbParameterCollection parameters)
{
// GROUP BY.
if (select.GroupBy != null && select.GroupBy.Fields.Count > 0)
{
output.Append(" ");
select.GroupBy.Render(dbms, output, parameters);
}
}
开发者ID:lordfist,项目名称:FistCore.Lib,代码行数:9,代码来源:GenericSelectRenderer.cs
示例13: Render
public void Render(SelectStatement select, DbmsType dbms, StringBuilder output, DbParameterCollection parameters)
{
// Uses ROWNUM instead of TOP. If ORDER BY is used then current SELECT statement is rendered
// using sub-queries. ROWNUM is used in outer query.
bool orderByIsUsed = (select.OrderBy != null && select.OrderBy.Count > 0);
if (select.Top > 0 && orderByIsUsed)
RenderOrderByInSubQueryAndRownumInOuterQuery(select, dbms, output, parameters);
else
RenderSingleQuery(select, dbms, output, parameters);
}
开发者ID:lordfist,项目名称:FistCore.Lib,代码行数:10,代码来源:OracleSelectRenderer.cs
示例14: OracleConnectionProvider
/// <summary>
/// Constructor. Sets DBMS type and connection string.
/// </summary>
/// <param name="dbmsType">DBMS type to which this provider connects to. Only Oracle compatibile values are allowed.</param>
/// <param name="connectionString">Connection string.</param>
public OracleConnectionProvider(DbmsType dbmsType, string connectionString)
{
if (connectionString == null)
throw new ArgumentNullException("connectionString", Messages.ConnectionProvider_ConnectionStringMayNotBeNull);
if (!IsSupportedDbms(dbmsType))
throw new ArgumentException(Messages.ConnectionProvider_UnsupportedDbmsType + dbmsType.ToString(), "dbmsType");
this.rdbms = dbmsType;
this.oraConn = new OracleConnection(connectionString);
}
开发者ID:lordfist,项目名称:FistCore.Lib,代码行数:15,代码来源:OracleConnectionProvider.cs
示例15: Render
/// <summary>
/// Renders DELETE statement.
/// </summary>
/// <param name="delete">DELETE statement to render.</param>
/// <param name="dbms">Target DBMS.</param>
/// <param name="output">StringBuilder to which SQL is appended.</param>
/// <param name="parameters">SQL parameter collection to which the object's and its children's
/// parameters are added. After the rendering is done the collection contains all parameters with unique names.</param>
public void Render(DeleteStatement delete, DbmsType dbms, StringBuilder output, DbParameterCollection parameters)
{
output.Append("DELETE FROM ");
delete.FromTable.RenderTableName(dbms, output);
if (delete.Where != null && !delete.Where.IsEmpty)
{
output.Append(" WHERE ");
delete.Where.Render(dbms, output, parameters);
}
}
开发者ID:lordfist,项目名称:FistCore.Lib,代码行数:19,代码来源:GenericDeleteRenderer.cs
示例16: IsSupportedDbms
private static bool IsSupportedDbms(DbmsType dbmsType)
{
switch (dbmsType)
{
case DbmsType.SqlServerCe_4:
return true;
default:
return false;
}
}
开发者ID:lordfist,项目名称:FistCore.Lib,代码行数:11,代码来源:SqlServerCeConnectionProvider.cs
示例17: Render
public void Render(SelectStatement select, DbmsType dbms, StringBuilder output, DbParameterCollection parameters)
{
AppendSelectAndDistinctKeyWords(select, output);
AppendTopExpression(select, output);
AppendSelectList(select, dbms, output, parameters);
AppendFromClause(select, dbms, output);
AppendWhereClause(select, dbms, output, parameters);
AppendGroupByClause(select, dbms, output, parameters);
AppendHavingClause(select, dbms, output, parameters);
AppendOrderByClause(select, dbms, output, parameters);
}
开发者ID:lordfist,项目名称:FistCore.Lib,代码行数:11,代码来源:SqlServerSelectRenderer.cs
示例18: Render
/// <summary>
/// Renders predicate as SQL statement.
/// </summary>
/// <param name="dbms">Target DBMS.</param>
/// <param name="output">StringBuilder to which SQL is appended.</param>
/// <param name="parameters">SQL parameter collection to which the object's and its children's
/// parameters are added. After the rendering is done the collection contains all parameters with unique names.</param>
public override void Render(DbmsType dbms, StringBuilder output, DbParameterCollection parameters)
{
output.Append("(");
if (Negate)
output.Append("NOT EXISTS (");
else
output.Append("EXISTS (");
PredicateItems[0].Render(dbms, output, parameters);
output.Append("))");
}
开发者ID:lordfist,项目名称:FistCore.Lib,代码行数:18,代码来源:ExistsPredicate.cs
示例19: IsSupportedDbms
private static bool IsSupportedDbms(DbmsType dbmsType)
{
switch (dbmsType)
{
case DbmsType.OdbcGeneric:
return true;
default:
return false;
}
}
开发者ID:lordfist,项目名称:FistCore.Lib,代码行数:11,代码来源:OdbcConnectionProvider.cs
示例20: AppendUpdateList
private static void AppendUpdateList(UpdateList list, DbmsType dbms, StringBuilder output, DbParameterCollection parameters)
{
output.Append(" SET ");
for (int setExpressionIdx = 0; setExpressionIdx < list.Count - 1; setExpressionIdx++)
{
list[setExpressionIdx].Render(dbms, output, parameters);
output.Append(", ");
}
list[list.Count - 1].Render(dbms, output, parameters);
}
开发者ID:lordfist,项目名称:FistCore.Lib,代码行数:11,代码来源:GenericUpdater.cs
注:本文中的DbmsType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论