- zetaenterpriselibrary-source.zip
- Caching
- Common
- Core
- Data
- Logging
- References
- Direct
- ICSharpCode.SharpZipLib.dll
- log4net.dll
- NUnit
- nunit.framework.dll
- nunit.framework.extensions.dll
- nunit.mocks.dll
- Externals
- ZetaLongPaths
- ZetaLongPaths.dll
- ZetaWebControlLibrary
- de
- ZetaWebControlLib.resources.dll
- ZetaWebControlLib.dll
- Tools
- UnitTests
- Properties
- Resources
- access.mdb
- Tests
- Common
- Data
- Logging
- Tools
- UnitTests.csproj
- Web
- Windows
- Base
- Common
- Configuration
- Controls
- Dialogs
- Misc
- Properties
- Windows.csproj
- Windows.snk
- ZetaEnterpriseLibrary.sln
- zetaenterpriselibrary-bin.zip
- de
- Zeta.EnterpriseLibrary.Common.resources.dll
- Zeta.EnterpriseLibrary.Data.resources.dll
- Zeta.EnterpriseLibrary.Logging.resources.dll
- Zeta.EnterpriseLibrary.Tools.resources.dll
- Zeta.EnterpriseLibrary.Web.resources.dll
- Zeta.EnterpriseLibrary.Windows.resources.dll
- ICSharpCode.SharpZipLib.dll
- log4net.dll
- Zeta.EnterpriseLibrary.Common.dll
- Zeta.EnterpriseLibrary.Common.pdb
- Zeta.EnterpriseLibrary.Data.dll
- Zeta.EnterpriseLibrary.Data.pdb
- Zeta.EnterpriseLibrary.Logging.dll
- Zeta.EnterpriseLibrary.Logging.pdb
- Zeta.EnterpriseLibrary.Tools.dll
- Zeta.EnterpriseLibrary.Tools.pdb
- Zeta.EnterpriseLibrary.Web.dll
- Zeta.EnterpriseLibrary.Web.pdb
- Zeta.EnterpriseLibrary.Windows.dll
- Zeta.EnterpriseLibrary.Windows.pdb
- ZetaLongPaths.dll
- ZetaLongPaths.pdb
|
namespace Zeta.EnterpriseLibrary.Data.Odbc
{
#region Using directives.
// ----------------------------------------------------------------------
using System;
using System.Data.Common;
using System.Data.Odbc;
using Base;
using Common;
using Properties;
using System.Runtime.InteropServices;
// ----------------------------------------------------------------------
#endregion
////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Helper class with statics, dealing with databases.
/// </summary>
/// <remarks>Parameters in the application configuration file (e.g. "<c>web.config</c>"):
/// - "<c>_connectionString</c>": The connection string for connecting to the database.
/// - "<c>traceSqlEnabled</c>": Turn tracing of SQL statements to LOG4NET on/off.
/// - "<c>cacheSqlEnabled</c>": Turn caching of SQL statements and their result inside
/// the ASP.NET web cache on/off.
/// - "commandTimeoutSeconds": Define an optional timeout for a command to execute.
/// This parameter is different from the connection timeout which
/// can be defined inside the connection string.</remarks>
[ComVisible( false )]
public sealed class AdoNetOdbcQuerier :
AdoNetBaseQuerier<
OdbcCommand,
OdbcConnection,
OdbcDataAdapter,
OdbcParameter>
{
/// <summary>
/// Creates the parameter collection.
/// </summary>
/// <param name="parameters">The parameters.</param>
/// <returns></returns>
public override IAdoNetParameterCollection CreateParameterCollection(
DbParameter[] parameters )
{
return new AdoNetOdbcParameterCollection( parameters );
}
public override IAdoNetTransactionScope CreateTransactionScope()
{
return new AdoNetOdbcTransactionScope( this );
}
#region Abstracts to override.
// ------------------------------------------------------------------
/// <summary>
/// Creates the updater.
/// </summary>
/// <returns></returns>
public override IAdoNetUpdater CreateUpdater()
{
return new AdoNetOdbcUpdater( this );
}
/// <summary>
/// Must override, return NULL for none.
/// </summary>
/// <value></value>
public override string QuotePrefix
{
get
{
return @"[";
}
}
/// <summary>
/// Must override, return NULL for none.
/// </summary>
/// <value></value>
public override string QuoteSuffix
{
get
{
return @"]";
}
}
/// <summary>
/// </summary>
/// <param name="connection"></param>
/// <param name="tableName"></param>
/// <returns></returns>
protected override string GetIdentitySelectSql(
DbConnection connection,
string tableName )
{
var type = CSManager.CheckGet(
new SmartConnectionString( connection.ConnectionString ) ).DatabaseType;
switch ( type )
{
case DatabaseType.SqlServer:
return string.Format(
@"SELECT IDENT_CURRENT('{0}')",
tableName );
case DatabaseType.Access:
return string.Format(
@"SELECT @@IDENTITY" );
default:
throw new ArgumentException(
Resources.Str_ZetaLib_Core_Data_AdoNetOdbcHelper_01.
Replace( @"{Type}", type.ToString() ) );
}
}
/// <summary>
/// Drops the table column.
/// </summary>
/// <param name="connectionString">The connection string.</param>
/// <param name="tableName">Name of the table.</param>
/// <param name="columnName">Name of the column.</param>
public override void DropTableColumn(
SmartConnectionString connectionString,
string tableName,
string columnName )
{
throw new NotImplementedException();
}
/// <summary>
/// Drops the index.
/// </summary>
/// <param name="connectionString">The connection string.</param>
/// <param name="tableName">Name of the table.</param>
/// <param name="indexName">Name of the index.</param>
public override void DropIndex(
SmartConnectionString connectionString,
string tableName,
string indexName )
{
throw new NotImplementedException();
}
/// <summary>
/// Drops all table constraints.
/// </summary>
/// <param name="connectionString">The connection string.</param>
/// <param name="tableName">Name of the table.</param>
public override void DropAllTableConstraints(
SmartConnectionString connectionString,
string tableName )
{
throw new NotImplementedException();
}
/// <summary>
/// Determines whether the specified connection string contains constraint.
/// </summary>
/// <param name="connectionString">The connection string.</param>
/// <param name="tableName">Name of the table.</param>
/// <param name="constraintName">Name of the constraint.</param>
/// <returns>
/// <c>true</c> if the specified connection string contains constraint; otherwise, <c>false</c>.
/// </returns>
public override bool ContainsConstraint(
SmartConnectionString connectionString,
string tableName,
string constraintName )
{
throw new NotImplementedException();
}
/// <summary>
/// Determines whether the specified connection string contains index.
/// </summary>
/// <param name="connectionString">The connection string.</param>
/// <param name="tableName">Name of the table.</param>
/// <param name="indexName">Name of the index.</param>
/// <returns>
/// <c>true</c> if the specified connection string contains index; otherwise, <c>false</c>.
/// </returns>
public override bool ContainsIndex(
SmartConnectionString connectionString,
string tableName,
string indexName )
{
throw new NotImplementedException();
}
/// <summary>
/// Check whether a constrained is present.
/// For creating and dropping constraints, see http://support.microsoft.com/?scid=kb%3Ben-us%3B291539.
/// </summary>
/// <param name="connectionString">The connection string.</param>
/// <param name="tableName">Name of the table.</param>
/// <param name="constraintName">Name of the constraint.</param>
public override void DropConstraint(
SmartConnectionString connectionString,
string tableName,
string constraintName )
{
throw new NotImplementedException();
}
// ------------------------------------------------------------------
#endregion
/// <summary>
/// Formats a date time value so that it fits the appropriate specification
/// for date formats to be usable from within a SQL query.
/// </summary>
/// <param name="dateToFormat">The date and time to format</param>
/// <returns>Returns the ready-to-use SQL string.</returns>
public override string FormatDateAndTime(
DateTime dateToFormat )
{
throw new NotImplementedException();
}
/// <summary>
/// Formats the date portion of a date time value so that it fits into
/// the appropriate specification for date formats to be usable from within a SQL query.
/// </summary>
/// <param name="dateToFormat">The date and time to format</param>
/// <returns>Returns the ready-to-use SQL string.</returns>
public override string FormatDateOnly(
DateTime dateToFormat )
{
throw new NotImplementedException();
}
/// <summary>
/// Formats the time portion of a date time value so that it fits into
/// the appropriate specification for date formats to be usable from within a SQL query.
/// </summary>
/// <param name="dateToFormat">The date and time to format</param>
/// <returns>Returns the ready-to-use SQL string.</returns>
public override string FormatTimeOnly(
DateTime dateToFormat )
{
throw new NotImplementedException();
}
/// <summary>
/// Gets or sets the lock object.
/// </summary>
/// <value>The lock object.</value>
public override object LockObject
{
get
{
return null;
}
set
{
// Do nothing.
}
}
}
////////////////////////////////////////////////////////////////////////////
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.