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
* 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/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 : 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
* Test/ProviderTests/System.Data.SqlClient/SqlAdapterTest.cs : Added testcases for #77480
* System.Data.Common/DbDataAdapter.cs :
- FillSchema :
- Add table to schema only if MissingSchemaAction is not Ignore
Add schema to table if MissingSchemaAction is set to either of
Add or AddWithKey
- BuildSchema :
- Set the Schema values only if MissingSchemaAction is set to
AddWithKey
svn path=/trunk/mcs/; revision=56830
* Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds.cs :
- Modified GetSqlMoney () , to set the precision and Scale correctly.
- Modified ProcessColumnDetails , to set the schema values correctly.
* Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsDataColumn.cs : Added some default values for the column schema
* System.Data/Test/ProviderTests/ProviderIndependant/DataReaderTest : Corrected a failing testcase.
* System.Data/Test/ProviderTests/System.Data.SqlClient/SqlCommandBuilderTest.cs : corrected a failing testcase
* System.Data/System.Data.SqlTypes/SqlDateTime : Corrected the MaxValue for SqlDateTime
* System.Data/System.Data.Common/DbDataAdapter.cs :
- Modified schema population to follow MissingSchemaAction and MissingMappingAction
- Add a column to the Primary Key only if its not a hidden key
- Added some argument checks
- Removed some redundant code
* System.Data/System.Data.Common/DataAdapter :
- Added argument checks
* System.Data/System.Data.Common/ExceptionHelper :
- Added InvalidEnumException , a helper function to print error msg
* System.Data/System.Data.SqlClient/SqlCommandBuilder.cs :
- Modified CreateUpdateCommand,CreateDeleteCommand , to not include
column name in the query if its a expression col.
Also, modified the queries to match the generated queries in ms.net
* System.Data/System.Data.SqlClient/SqlCommand.cs :
- Modifed Prepare, to check if Parameter is explicitly initialized
* System.Data/System.Data.SqlClient/SqlParameter.cs :
- Added CheckIfInitialized : Checks if datatype is explicitly set and
non-zero size is set for variable datatypes.
* System.Data/System.Data.SqlClient/SqlDataReader.cs :
- Added code for GetSqlBinary ()
- Fixed GetFieldCount ()
- Added more checks and exceptions.
Fixes most of the failing SqlClient Provider Tests .
svn path=/trunk/mcs/; revision=56167
* Test/ProviderTests/System.Data.SqlClient/SqlDataAdapterTest.cs :
- Added Testcase for bug #76433.
* In System.Data.Common/DbDataAdapter.cs :
- BuildSchema() : Set the value of DataColumn Property 'AllowDBNull'
as returned by database. Fixes bug#76433.
svn path=/trunk/mcs/; revision=51791
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-07-15 Sureshkumar T <[email protected]>
* DataTableMappingCollection.cs: GetTableMappingBySchemaAction:
meaningful error message if mapping is missing.
* DbDataAdapter.cs: Update: meaningful message if table is missing.
In System.Data.SqlClient:
2005-07-15 Sureshkumar T <[email protected]>
* SqlCommandBuilder.cs:
- set_DataAdapter: unsubscribe event if DataAdapter is reset.
- CreateInsertCommand, CreateUpdateCommand, CreateDeleteCommand:
if column mapping is missing, use the source column name. use
proper version to get the data.
- RowUpdatingHandler: set status to continue to actually process
the query.
svn path=/trunk/mcs/; revision=47340
2005-04-22 Sureshkumar T <[email protected]>
* DataTableLoadRowTest.cs: Added. A test case for testing
LoadDataRow method of DataTable. This tests for various
possiblities of row state and loadoption.
In System.Data.Common:
2005-04-22 Sureshkumar T <[email protected]>
* DbDataAdapter.cs: Moved FillTable and BuildSchema as static
methods as they are not operating on the current instance. This
could be reused to fill any table from a data reader.
* RecordCache.cs: While disposing records, make sure that the
record is not already disposed. i.e. to make sure later the same
record is not reused. Implemented a static method to compare two
version of records in a container.
In .:
2005-04-22 Sureshkumar T <[email protected]>
* System.Data_test.dll.sources: Added DataTableLoadRowTest.cs.
In System.Data:
2005-04-22 Sureshkumar T <[email protected]>
* LoadOption.cs: Changed the enums. Keeping old values for
migration.
* DataTable.cs: Implemented methods Load and its overloads. Also
implemented LoadDataRow.
* DataRowCollection.cs: Added a variation of the Find method to
return a row even if it is of state Deleted. This is required for
DataTable.LoadDataRow method.
* DataRow.cs: Implemented internal helper method Load for loading
values from an object array and given an LoadOption (2.0 feature).
* DataRowAction.cs: Added few more enums for .net 2.0. Sorted
alphabetically.
svn path=/trunk/mcs/; revision=43440
2005-04-18 Sureshkumar T <[email protected]>
* DataAdapter.cs: Implemenetd OnFillError handler.
* DbDataAdapter.cs: BuildSchema (): the table to be filled might
contain few additional columns as well. so mapping length should
be columns' length + fields' length.
In System.Data:
2005-04-18 Sureshkumar T <[email protected]>
* DataRow.cs: if there are no mapping fields, fill with default
value.
svn path=/trunk/mcs/; revision=43192
* DbDataAdapter.cs: For Update, disable ReadOnly constraint
temporarily before updating the row. Info from Ingo Bauersachs.
SkipAllRemainingRows should also skip current row (msdn).
svn path=/trunk/mcs/; revision=42186
* DbDataAdapter.cs: Update (): update the rows based on the
UpdateRowSource property. Process further based on the
RowUpdatedEvent handler argument's Status property.
Fixes bug #73587. Thanks to [email protected] (Ingo Bauersachs) for
bug report and patch.
svn path=/trunk/mcs/; revision=42094
* DbDataAdapter.cs (Update ()) :
- Check for one return result set and map the values back to
datatable.
- Check for output & return value parameters and update the value
back to mapped column
- check for recordsAffected only after closing the reader.
svn path=/trunk/mcs/; revision=40120
* DbDataAdapter.cs (BuildSchema): Add the primary key schema iff
MissingSchemaAction is set to AddWithKey. Also, Add auto increment
value from the source table. fixes bug #67757 and #69110.
svn path=/trunk/mcs/; revision=37567
* DbDataAdapter.cs: Fix for out of memory exceptions when trying to fill a dataset with a query which doesn't return a resultset like insert, delete or update.
svn path=/trunk/mcs/; revision=33127
* DataContainer.cs - added. Provides implementation for data containers that holds data in arrays of primitives or objects. Each data container belongs to specific DataColumn.
* DbDataAdapter.cs - changes to complete data storage redesign. Bug fix in FillTable ( to fetch exact number of records required ).
svn path=/trunk/mcs/; revision=27655
- Reader can have empty results (fo example from UPDATE or DELETE).
- Reader can have results with no rows (SELECT that returns 0 rows but have columns)
- In FillTable - skip rows only once for each table.
svn path=/trunk/mcs/; revision=25961
* DbDataAdapter.cs : Refactoring of Fill. New private method
FillTable does most of the work now. Use int[] instead of
hashtable for mapping. Move creation of tableArray[] outside
of loop.
svn path=/trunk/mcs/; revision=24031
* DbDataAdapter.cs: handle MissingShemaAction.AddWithKey, call
AcceptChanges in Update when a CommandBuilder is used and
correctly fill information about primary keys in FillSchema.
Patch from Sergei Malinin ([email protected]).
svn path=/trunk/mcs/; revision=21553
* DbDataAdapter.cs: Call command dispose in self dispose method. We
need to dispose the connections and other stuff stored in the
commands.
svn path=/trunk/mcs/; revision=20355