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
Leaves it up to deriving classes to override Dispose (bool) and
perform a rollback if necessary. Fixes bug #325397. Code formatting.
* ExceptionHelper.cs: Added TransactionNotUsable method that constructs
an InvalidOperationException to be thrown by IDbTransaction
implementations when the transaction is no longer open.
* OdbcTransaction.cs: Keep state of the transaction, and update it
when performing commit or rollback. In Dispose (bool), only perform
a rollback if transaction was not committed or rollback before.
In Commit and Rollback, throw an InvalidOperationException if
transaction is no longer open.
* SqlTransaction.cs: Avoid unnecessary initialization. Remove
isRolledBack since its essentially the same as isOpen. Use
ExceptionHelper.TransactionNotUsable instead of duplicating code.
On 2.0 profile, ignore call to Rollback when transaction was already
disposed.
* OleDbTransaction.cs: Keep track of whether transaction is open and
whether it's disposed. In Commit an Rollback, throw an IOE if the
transaction is no longer open. In Dispose (bool), perform a rollback
if the transaction is still open.
svn path=/trunk/mcs/; revision=87835
* DbConnectionStringBuilder.cs (Init): Modified the dictionary to
use StringComparer.InvariantCultureIgnoreCase.
(Add, ContainsKey): Checks whether argument is null or empty string.
svn path=/trunk/mcs/; revision=80465
* ConnectionStringsExpressionBuilder.cs: support expressions with
suffixes .ProviderName and .ConnectionString (case-insensitie) and
generate a call to GetConnectionStringProviderName in the former
case. Fixes bug #81490
2007-04-30 Marek Habersack <[email protected]>
* SqlDataSource.cs: do not catch the exception if ProviderName is
not null or empty (as per docs and what MS.NET does).
2007-04-30 Marek Habersack <[email protected]>
* DbProviderFactories.cs: throw the same exception MS.NET does.
svn path=/trunk/mcs/; revision=76486
of clear and remove nodes.
* DbProviderFactoriesConfigurationHandler.cs: Added support for
clear node.
* DbProviderFactoriesConfigurationHandlerTest.cs: Changed test to also
verify behavior for clear and remove nodes.
svn path=/trunk/mcs/; revision=73663
pass on MS. Added NotWorking test to check whether DbProviderFactories
that are defined on machine config are available.
* ConnectionStringsSectionHandler.cs: Removed since the 2.0 config
API is in place.
* DbProviderFactoriesConfigurationHandler.cs: Fixed name of DataSet
to match MS. Removed SupportedClasses column since this is no longer
part of 2.0 profile (removed during beta). Throw
ConfigurationErrorsException for unrecognized elements. Mark methods
private, and refactor them. Added FIXMEs for missing checks for
unrecognized attributes.
* DbProviderFactories.cs: Marked constants internal. Replaced spaces
with tabs. Use ConfigurationManager.GetSection instead of deprecated
ConfigurationSettings.GetConfig.
* app_test_2.0.config: Fixed assembly qualified names of config
handler. Removed usage of ConnectionStringsSectionHandler, since
this is now handled by 2.0 config system. Spaces to tabs.
* System.Data.dll.sources: Removed ConnectionStringsSectionHandler.
svn path=/trunk/mcs/; revision=73659
* DbProviderFactoriesConfigurationHandler.cs : remove "support"
attribute check, as it does not really do anything.
svn path=/trunk/mcs/; revision=73417
* DbProviderFactory.cs: Derived class has to implement all the
methods of this class.
* DbProviderFactoriesConfigurationHandler.cs (Create): Removed
bogus MonoTODO
svn path=/trunk/mcs/; revision=72538
* DataColumnMapping.cs (GetDataColumnBySchemaAction): Implemented
2.0 profile method.
* DbDataReader.cs: Removed TODO's where ever the implementation is
available.
* RowUpdatedEventArgs.cs: Removed TODO's where ever the
implementation is available.
* DataAdapter.cs (FillInternal): Moved from DbDataAdapater.cs to
here.
(BuildSchema): Moved from DbDataAdapter.cs.
(FillTable): Moved from DbDataAdapter.cs.
(OnFillErrorInternal): Implemented new internal method to raise an
event.
(SetupSchema): Moved from DbDataAdapter.cs.
(FillInterl): Moved common implementation from DbDataAdapter.cs.
Removed TODO's where ever the implementation is available.
* DbDataAdapter.cs (OnRowUpdated): Implemented protected method.
(OnRowUpdating): Implemented protected method.
(CreateFillErrorEvent): Moved to DataAdapter.cs.
(Fill): Moved common implementation to DataAdapter.cs.
(FillTable): Moved to DataAdapter.cs.
(BuildSchema): Moved to DataAdapter.cs.
(SetupSchema): Moved to DataAdapter.cs.
svn path=/trunk/mcs/; revision=69818
* Test/System.Data/DataViewTest2.cs :
- Tests for ToTable overloads
- Test for Equals method
- Tests to check for the Sort, RowFilter values when
DataView is created and when Table is set.
* Test/System.Data/DataViewTest_IBindingList.cs :
- Ensure tests do not depend on the order of
execution.
* Test/System.Data/DataViewTest_IBindingListView.cs : New
- Tests for IBindingListView interface methods
* System.Data.Common/Index.cs :
- GetAllRows : Added. Returns all the rows in the current
index.
- GetDistinctRows :Added. Returns all the distinct rows (based
in Key Columns) in the index.
* System.Data.dll.sources:
- Added to build :
Test/System.Data/DataViewTest_IBindingListView.cs
* System.Data/DataView.cs :
- ToTable : Implemented all the overloads
- Equals : Implemented
- IBindingListView : Implemented the interface
svn path=/trunk/mcs/; revision=62669
* Test/System.Data/DataSetTest2.cs : Test the behavior of EnforceConstraints
* Test/System.Data/DataViewTest_IBindingList.cs : Test to ensure the correct index is
used for comparision
* Test/System.Data/DataRowTest2.cs : Test to ensure the RowErrors and ColumnErrors are
filled correctly.
* System.Data.Common/Key.cs :
-Equals : Check for Equality of Sort Order too.
* System.Data/DataSet.cs :
- InternalEnforceConstraints : Check if any null constraints
are violated. Throw ConstraintException only after all the errors
are filled.
* System.Data/DataTable.cs :
- EnforceConstraints : Move away the logic to check for
NullConstraintViolation.
- AssertNotNullConstraint : Checks for Null Constraint
Violation.
- EndLoadData : Do not throw any exceptions here. All the
errors have to be found and RowErrors set before throwing the
exception.
* System.Data/DataRow.cs :
- ImportRecrod : Check the values of the row for any null
values.
- SetColumnError : If the error for column is already set,
do not add a new error but edit the existing error.
- CheckValue : Set the NullConstraintViolation flag if either
table is being loaded or if EnforceConstraints is set to
false.
* System.Data/Constraint.cs : Do not throw exception when EnforceConstraints is
set to false or table is being loaded.
* System.Data/UniqueConstraint.cs : Correct the error message. Set ColumnErrors
along with the RowError.
svn path=/trunk/mcs/; revision=61744
* Test/ProviderTests/System.Data.SqlClient/SqlCommandBuilderTest.cs :
- Corrected the testcase to check for queries corresponding to
ms.net 2.0
- verify that columns that do not allow nulls are not included
in the null-checks.
- Added testcase to check for DBConcurrencyException for
Delete Command.
- Check the DataType of the null-check parameters
* System.Data.Common/DbDataAdapter.cs :
* Update () : If the Update/Delete Query has a null check,
then populate the parameter value correctly.
* System.Data.SqlClient/SqlCommandBuilder.cs :
* CreateDeleteCommand ()
* CreateUpdateCommand ()
* CreateInsertCommand ()
- Changed the signature. Do not need DataRow parameter
as the Query generated is parametric.
- Correct the null-check term in the WhereClause, set the
correct properties for null-check parameter
fixes#78027
- Modified the generated query to match the query as
generated by 2.0. We now ignore null-check in the
whereclause if the Column does not allow nulls.
* ctor () : Set QuotePrefix and QuoteSuffix for 2.0 profile
* GetUpdateCommand ()
* GetInsertCommand ()
* GetDeleteCommand ()
- Do not create new command everytime. Create only if
not already created.
* RefreshSchema : Reset the commands.
svn path=/trunk/mcs/; revision=59175
* Test/System.Data/DataRowCollectionTest2.cs :
* Test/System.Data/DataTableTest2.cs :
- Fixed NotWorking tests.
* System.Data.Common/Index.cs :
- Update () : Add the new record in the correct position
* System.Data/DataRow.cs :
- RejectChanges () : Add the row to index, if it was in deleted state and
Update the index if in Modified State.
- AcceptChanges () : Do not update the Indexes.
- EndEdit () : Update the indexes even if BeginLoadData has been called
on the table. Ideally, indexes should not be maintained during DataLoad,
but this needs to handled in multiple places correctly. For now, just maintain
the index to ensure correct operation.
svn path=/trunk/mcs/; revision=57725
* Test/System.Data/DataRowCollectionTest2.cs : Check if index is maintained for row on calling RejectChanges.
* Test/System.Data/DataTableTest2.cs : Check if data is loaded and merged (if key exists) correctly.
* Test/System.Data/ForeignKeyConstraintTest.cs : Check if a ParentColumn value can be modified
when the row is in 'Added' State. Also, check if child col values are
updated correctly.
* Test/ProviderTests/System.Data.SqlClient/SqlAdapterTest.cs : Added testcases for verifying FillError Behavior
* System.Data.Common/DbDataAdapter.cs :
- FillTable : Move BeginLoadData, EndLoadData outside the loop. Also,
move EndLoadData outsidet try,catch block. FillError is only for errors
occuring during loading the data into datatable.
* System.Data.Common/Key.cs :
- Set Default value of RowStateFilter to (CurrentRos | OriginalRows).
- ContainsVersion : If RowStateFilter is set to default value, return true
for Modified Rows as they can contain Default/Original versions.
* System.Data/DataRow.cs
- RejectChanges : Do not remove Row from Indexes when state is Deleted.
- CheckChildRows : When checking for the ChildRows, use the current value
and not the original value.
svn path=/trunk/mcs/; revision=57149
* DbProviderFactory.cs: remove two methods. and mark the
DbProviderSupportedClasses ctor as internal since it's not part of
the public api.
* DbTable.cs: remove this class from 2.0 build.. leave it for the
JVM build, I guess?
* RowUpdatingEventArgs.cs: this class isn't abstract in 2.0.
* RowUpdatedEventArgs.cs: this class isn't abstract in 2.0.
* SupportedJoinOperators.cs: new 2.0 enum.
* CatalogLocation.cs: fix enum values.
* GroupByBehavior.cs: same.
* IdentifierCase.cs: same.
* SchemaTableColumn.cs: class is static, not sealed. and add
missing elements.
* SchemaTableOptionalColumn.cs: same.
svn path=/trunk/mcs/; revision=57008