value for CommandType and UpdatedRowSource. In Dispose, clear
CommandText (2.0 only) and Parameters. Include method that is being
executed in the exception messages for Connection and CommandText
verification.
* OdbcCommandTest.cs: Added tests for CommandTimeout,
UpdatedRowSource, Dispose and ResetCommandTimeout. Added
ExecuteNonQuery/ExecuteReader/ExecuteScalar tests for a connection
that is not initialized or closed.
svn path=/trunk/mcs/; revision=123742
* OdbcColumn.cs: Treat OdbcType.Numeric as decimal.
* OdbcConnection.cs: Keep (weak) list of commands to allow us to
dispose them (and free their corresponding statement handles) when
the connection is closed. Fixed bug #341743.
* OdbcCommand.cs: Add internal Unlink method that is invoked when the
OdbcConnection is disposed, and which frees the statement handle.
Modified ExecuteNonQuery helper to take CommandBehavior and rename
freeHandle argument to createReader. Added CommandBehavior argument
to ExecSQL. Added FreeStatement overload that takes an option to not
perform an unlink. Fixes bug #3417434.
svn path=/trunk/mcs/; revision=122226
OdbcConnection to create OdbcException.
* OdbcException.cs: Added support for multiple OdbcError instances
and fixed Message property on 2.0 profile.
* OdbcCommand.cs: Use internal CreateOdbcException method on
OdbcConnection to create OdbcException. Code formatting.
* OdbcError.cs: Moved code to obtain ODBC error info to newly
introduced CreateOdbcException on OdbcConnection. Code formatting.
* OdbcDataReader.cs: Use internal CreateOdbcException method on
OdbcTransaction to create OdbcException.
* OdbcParameterCollection.cs: Removed obsolete Bind method.
* OdbcConnection.cs: Added SafeDriver property that returns
name of driver if available and a zero-length string otherwise.
Use CreateOdbcException method to create OdbcException from ODBC
error info. Added CreateOdbcException method to construct
OdbcException from all available ODBC error info.
* OdbcParameter.cs: Use internal CreateOdbcException method on
OdbcConnection to create OdbcException.
svn path=/trunk/mcs/; revision=98891
OdbcCommandTest.cs, OdbcConnectionTest.cs, OdbcDataAdapterTest.cs,
OleDbCommandTest.cs, OleDbConnectionTest.cs, OleDbDataAdapterTest.cs,
SqlDataAdapterTest.cs.
* DbDataAdapter.cs: Implemented UpdateBatchSize setter.
* DataAdapter.cs: In FillLoadOption setter, ensure value is valid.
Modified MissingMappingAction and MissingSchemaAction setters to use
ExceptionHelper.CheckEnumValue to validate value. Spaces to tabs and
code formatting.
* ExceptionHelper.cs: Added CheckEnumValue method and modified
InvalidEnumValueException method to return AORE on 2.0 profile. Added
ConnectionClosed method that returns an InvalidOperationException.
* OleDbDataAdapter.cs: In default ctor, set SelectCommand to null.
Only initialize SelectCommand in ctors. Use direct assignment in
IDbDataAdapter implementation.
* OleDbCommand.cs: Added constant for default CommandTimeout, instead
of using a magic number. Avoid unnecessary initialization. Fixed
default value for DesignTimeVisible. Return zero-length string if
CommandText is null. Added implementation for UpdatedRowSource.
* OleDbConnection.cs: Moved initialization of gda to Open ().
Avoid unnecessary initialization. Return zero-length string if
ConnectionString is null. If getters to Database, DataSource and
Provider return zero-length string if the connection is closed.
In ServerVersion, BeginTransaction and GetSchema, throw an
InvalidOperationException if connection is closed.
* OdbcCommand.cs: Added constant for default CommandTimeout, instead
of using a magic number. Avoid unnecessary initialization. Fixed
default value for DesignTimeVisible. Return zero-length string if
CommandText is null. Spaces to tabs and code formatting.
* OdbcError.cs: Fixed typo in exception message.
* OdbcConnection.cs: Return zero-length string if ConnectionString is
null. In getters for Database, DataSource and Driver return a
zero-length string if connection is closed. In BeginTransaction and
GetSchema throw InvalidOperationException if connection is closed.
Added override for GetSchema (string, string []). Use string.Empty
instead of "".
* OdbcDataAdapter.cs: Avoid unnecessary initializations. Use direct
assignment in IDbDataAdapter implementation. In default ctor, set
SelectCommand to null.
* SqlCommand.cs: Added constant for default CommandTimeout, instead
of using a magic number. Avoid unnecessary initialization. Fixed
default value for DesignTimeVisible. Return zero-length string if
CommandText is null. Use ExceptionHelper.InvalidEnumValueException
to avoid code duplication. Spaces to tabs and code formatting.
* SqlConnection.cs: Use different default package size on 2.0 profile.
Added constants for default values, instead of using magic numbers.
Avoid unnecessary initialization. In PacketSize, return default or
configured packet size when connection is not open. Use
ExceptionHelper.ConnectionClosed instead of local method. Removed
use of some hardcoded values in SetDefaultConnectionParameters, and
use Environment.MachineName as default WorkstationId instead of
DNS host name. Code formatting.
* SqlDataAdapter.cs: In default ctor, set SelectCommand to null.
Avoid unnecessary initializations. Use direct assignment in
IDbDataAdapter implementation. Fixed exception message for negative
UpdateBatchSize. In Dispose override, make sure to invoke base
method.
* DbDataAdapterTest.cs: Added test for UpdateBatchSize.
* DataAdapterTest.cs: Added tests for AcceptChangesDuringFile,
AcceptChangesDuringUpdate, ContinueUpdateOnError, FillLoadOption,
MissingMappingAction, MissingSchemaAction and
ReturnProviderSpecificTypes.
* OdbcDataAdapterTest.cs: Added tests for ctors, DeleteCommand,
InsertCommand, SelectCommand, UpdateCommand and Dispose.
* OdbcDataReaderTest.cs: fixed line endings.
* OdbcCommandTest.cs: Added tests for ctors and CommantText.
* OdbcConnectionTest.cs: Removed original test that relied on MySQL.
Added ctor tests. Added tests for BeginTransaction, GetSchema and
ServerVersion with connection that is closed.
* OleDbDataAdapterTest.cs: Added tests for ctors, DeleteCommand,
InsertCommand, SelectCommand, UpdateCommand and Dispose.
* OleDbCommandTest.cs: Added tests for ctors and CommandText.
* OleDbConnectionTest.cs: Added tests for ctors and ConnectionString.
Added tests for BeginTransaction, GetSchema and ServerVersion with connection that is closed.
* SqlCommandTest.cs: Added tests for ctors and CommantText.
* SqlConnectionTest.cs: Added tests for ctors, ConnectionString and
ServerVersion.
* SqlDataAdapterTest.cs: Added tests for ctors, DeleteCommand,
InsertCommand, SelectCommand, UpdateCommand, UpdateBatchSize and
Dispose.
svn path=/trunk/mcs/; revision=87859
System.ComponentModel.Component already calls Dispose.
* SqlParameter.cs: Removed explicit interface implementation of
IDataParameter.ParameterName.
* OdbcErrorCollection.cs: Removed explicit interface implementation
of IEnumerable.GetEnumerator ().
* OdbcCommand.cs: Removed destructor as the destructor in
System.ComponentModel.Component already calls the Dispose method.
Removed explicit interface implemenation of members that are
implement by public members.
* OdbcDataReader.cs: Removed explicit interface implemenation of
IDataRecord.GetData.
* OleDbErrorCollection.cs: Removed explicit interface implementation
of IEnumerable.GetEnumerator ().
* OleDbParameterCollection.cs: Removed explicit interface
implementation members that are already implementation by public
members.
* DataTable.cs: Renamed initInProgress to fInitInProgress. BeginInit
and EndInit must only be virtual in 2.0 profile. Set eol-style to CRLF.
svn path=/trunk/mcs/; revision=61328
* System.Data.dll.sources: added
System.Data.Odbc/NativeBuffer.cs. native buffer pointer.
In System.Data.Odbc:
* OdbcParameter.cs: re-implemented the native buffer handling and
odbc type handling.
* OdbcCommand.cs (BindParameters): Copy the parameter Value after
binding.
* NativeBuffer.cs: A native buffer class to hold pointer to native
memory.
* OdbcTypeMap.cs (OdbcTypeMap): structure to hold different odbc
types and the default mapping.
* OdbcTypeConverter.cs: Simplified mapping between different odbc
types using switch-case.
* libodbc.cs (SQLBindParameter): use only one entry point and use
IntPtr instead of ref.
svn path=/trunk/mcs/; revision=51463
* OdbcDataReader.cs: Implemented Dispose pattern. Cache
schematable for same result set. don't free command's statements
if the command is prepared.
* OdbcCommand.cs:
- Implemented Dispose pattern
- Streamlined the allocation and de-allocation of statement
handles.
svn path=/trunk/mcs/; revision=48120
* OdbcCommand.cs: Prepare (): Split SQLPrepare and SQLBind so that
already prepared statements can be reused with new parameter
values. ExecSQL (): create new statement handle, if not prepared
and there are no parameters. if there are parameters, prepare and
use.
svn path=/trunk/mcs/; revision=48118
2005-08-05 Sureshkumar T <[email protected]>
* DbDataAdapter.cs:
- Update (): set parameter values only after getting the
appropriate command from command builder. Close reader only if it
is not closed before. Use parameter's SourceVersion. Whitespace
corrections to comply with standard.
In System.Data.SqlClient:
2005-08-05 Sureshkumar T <[email protected]>
* SqlCommandBuilder.cs: Set SourceVersion property to the created
parameters as it is used by the Adapter's Update method.
In System.Data.Odbc:
2005-08-05 Sureshkumar T <[email protected]>
* OdbcDataReader.cs: RecordsAffected: get value from command.
GetSchemaTable (): set IsExpression based on BaseTableName. set
AllowDBNull to false if the column is PK.
* OdbcCommand.cs: correct UpdatedRowSource is returned. whitespace
changes to conform to standard.
* OdbcCommandBuilder.cs: Implemented.
* OdbcParameter.cs: Direction is set to Input by default.
svn path=/trunk/mcs/; revision=48043
2005-03-10 Sureshkumar T <[email protected]>
* System.Data.dll.sources: Added
System.Data.Odbc/OdbcConnectionFactory.cs.
System.Data.Odbc/OdbcFactory.cs.
In System.Data.Odbc:
2005-03-10 Sureshkumar T <[email protected]>
Migrated core classes to derive from ProviderBase instead of
implementing IDb* interfaces. Most part of these files have been
branched with #if NET_2_0/ONLY_1_1. Make sure any changes works
with both the profiles.
* OdbcFactory.cs: Concrete Factory for DbProviderFactory. Factory
to generate Connection,Command,etc.
* OdbcConnectionFactory.cs: Concrete factory for DbConnectionFactory.
* OdbcTransaction.cs: migration and overrides.
* OdbcCommandBuilder.cs: migration and overrides.
* OdbcDataReader.cs: --do--. no command behavior member as it will
be maintained in base provider class.
* OdbcParameterCollection.cs: --do--. Now, local ArrayList is not
maintained here, instead it is in base class. Most of the methods
which operated on this list are not needed in NET_2_0.
* OdbcConnection.cs: Migration. connectionString is maintained in
DbConnectionBase class.
* OdbcParameter.cs: Migration. Many of the local members like
value,sourceColumn are maintained in DbParameterBase.
* OdbcCommand.cs: Migration. commandText,timeout and
commandTimeOut are maintained in DbCommandBase class.
svn path=/trunk/mcs/; revision=41643
to fix signature of OdbcConnection
* OdbcDataReader.cs: No longer use ODbcConnection.Datareader, in
order to fix signature of OdbcConnection
* OdbcConnection.cs: Signature fixes: removed DataReader property,
added setter for ConnectionTimeout, made transaction internal
* OdbcParameter.cs: reduced accessibility of Bind method to
internal, added setter for IsNullable
* OdbcParameterCollection.cs: made default ctor and Bind method
internal
svn path=/trunk/mcs/; revision=26991
- Fixed TinyInt mapping (Thanks Daniel for finding the bug!)
- ExecuteScalar is supported
- Support CloseConnection CommandBehavior for ExecuteReader
- Implemented full error handling support: OdbcException, OdbcError, OdbcErrorCollection
- Parameter support for all data types (needs further optimization)
svn path=/trunk/mcs/; revision=8429
- Added OdbcTransaction Object and moved transaction logic out of connection and into new object.
- Support for DSN-less connection strings
- Fixed OdbcType enum to have correct values
- General cleanup on all objects
- Implemented Cancel in OdbcCommand
- Added DBNull support
- Updated OdbcType enum with values from header files.
- Modified column description code to happen dynamically as a column is accessed
instead of describing all columns when the query opens
- Works with SqlSharp
Known Issues:
- Transaction Isolation Level isn't handled
- A number of data types are returned as strings instead of native types
- Parameter support is weak -- only supports int types
- ExecuteReader: CommandBehavior isn't implemented
- ExecuteScalar not implemented
- Need better error handling
svn path=/trunk/mcs/; revision=8233