overload that can be used to retrieve an existing connection pool.
Modified ResetConnectionPool () to skip free slots in the pool and to
close pooled connections that are not in use. Pooled connections that
are in use are now marked as non-pooled so that they are no longer
returned to the pool when they are closed. Fixes bug #443131.
* SqlConnection.cs: In Close, also remove reference to pool. In Open,
set TdsConnection.Pooling to false for a non-pooled connection.
Fixed ClearAllPools to no longer create a new connection for each
pool. In ClearPool, perform a lookup of the pool to clear using
the connectionstring as the pool field may refer to another pool
(as the connectionstring may have changed).
* SqlConnectionTest.cs: Added tests for ClearPool and ClearAllPools.
svn path=/trunk/mcs/; revision=118308
* System.Data.SqlClient/SqlConnectionStringBuilder.cs: modified -
add missing connection options, correct case of some connection options,
added dictionary for mapping
defaults, for Item this indexer needs to return a default
for a valid keyword if it does not exist in the dictionary,
must override the Keys and Values collection to return all keys
and values whether or not they exist in the dictionary and if
they do not then return a default value for Values
svn path=/trunk/mcs/; revision=111781
zero-length string, then fallback to default value for boolean and
integer backed properties. Throw ArgumentException when min pool size
exceeds max pool size. Check whether value for 'MARS' is a bool.
The 'user instance' property is 2.0 only.
* SqlConnectionTest.cs: Enabled connection string related tests that
previously failed. Added/improved connection string tests.
svn path=/trunk/mcs/; revision=110471
* SqlCommand.cs (ExecuteReader): When behavior includes SingleRow,
then only return a single result. Fixes bug #412569.
svn path=/trunk/mcs/; revision=109065
CommandTimeout to match MS. On 2.0 profile, throw NRE in Prepare
when connection is NULL. In Prepare, return immediately after
connection check (2.0 only) for stored procedures, or when no
parameters are added. Added check to see if transaction is
associated with same connection as the command and updated
exception messages.
* SqlCommandTest.cs: Enabled CommandTimeout test. Enabled test for
Prepare with NULL connection. Enabled test for bug #412586.
* SqlCommandTest.cs: Enabled and improved tests for pending transaction
and transaction that is not associated with connection. Added tests for
Prepare.
svn path=/trunk/mcs/; revision=109058
whether an async method is being executed. Minor changes to exception
messages to match MS.
* SqlCommandTest.cs: Enabled and improved tests for Execute* with closed
connection.
* SqlCommandTest.cs: Enabled and improved tests for Execute* with only a
transaction set.
svn path=/trunk/mcs/; revision=109043
Fixes bug #412584. Removed unused moreResults eargument from
CloseDataReader. Removed behavior argument from Execute, and have it
use the behavior field instead. In ValidateCommand, throw
InvalidOperationException instead of NRE when Connection is NULL.
* SqlDataReader.cs: Sync with SqlCommand's CloseDataReader signature
change.
* SqlCommandTest.cs: Enabled test for bug #412584.
svn path=/trunk/mcs/; revision=109033
Transaction to be set when a reader is open for the current connection.
Fixes bug #412579.
* SqlCommandTest.cs: Enabled test for bug #412579.
svn path=/trunk/mcs/; revision=109021
if transaction is in progress. Fixes bug #412576. On 1.0 profile, throw
InvalidOperationException when a reader is open for the current
connection. Do not set transaction to NULL when changing connection,
instead set it to null in Transaction when transaction is no longer
open.
* SqlCommandTest.cs: Enabled and improved test for bug #412576.
Enabled test for changing Connection while reader is open.
svn path=/trunk/mcs/; revision=109018
field. Remove Init method, as initialization is done in
SetDefaultConnectionParameters. Initialize parms in
SetDefaultConnectionParameters to avoid calling Reset on newly
initialized collection. In Dispose (bool), also invoke base.Dispose if
SqlConnection was already disposed. Fixes bug #412571.
* SqlConnectionTest.cs: Enabled and improved test for bug #412571.
svn path=/trunk/mcs/; revision=109013
equals original state. Fixes bug #412574. Removed extra whitespace.
* SqlConnectionTest.cs: Enabled test for bug #412574.
svn path=/trunk/mcs/; revision=109009
* SqlParameterCollection.cs: this [int] must check the range and
throw an exception if necessary.
* SqlCommand.cs: throw IOEX when stored procedure is not found in
DeriveParameters. All procedures in MS SQL will report at least
one parameter - the return value.
svn path=/trunk/mcs/; revision=105657
match MS. Code formatting.
* SqlCommand.cs: Changed argument names to match MS. Code formatting.
Do not include explicit IDbCommand implementation on 2.0 profile.
* SqlCommandBuilder.cs: Changed argument names to match MS. Code
formatting.
* SqlDataReader.cs: Changed argument names to match MS. Code
formatting.
* SqlParameterCollection.cs: Do not include IList, ICollection and
IDataParameterCollection explicit interface implementation on 2.0
profile. Code formatting.
* SqlConnection.cs: Changed argument names to match MS.
* SqlDataAdapter.cs: Changed argument names to match MS.
* SqlTransaction.cs: Do not include explicit interface implementation
of IDbTransaction.Connection on 2.0 profile. Code formatting.
svn path=/trunk/mcs/; revision=101355
2008-04-19 Robert Jordan <[email protected]>
* SqlCommandTest.cs: Add test case for bug #381100.
In System.Data.SqlClient:
2008-04-19 Robert Jordan <[email protected]>
* SqlParameterCollection.cs (AddRange(SqlParameter[])):
Fix endless recursion.
svn path=/trunk/mcs/; revision=101212
* SqlConnection.cs: TCP port discovery via UDP port 1434 should
honor the timeout specified in the connection string (or the
default one). In some environments 100 microseconds might not be
enough to discover the port.
svn path=/trunk/mcs/; revision=100077
* SqlParameter.cs: ConvertToFrameworkType must handle empty
strings gracefully - a DBNull.Value must be returned in this
case.
* SqlCommand.cs: DeriveParameters should split the stored
procedure name into the schema name and procedure name before
querying its parameters.
svn path=/trunk/mcs/; revision=99553
* System.Data.dll.sources: Add new OleDbMetaDataCollectionNames.cs
* System.Data_test.dll.sources: Add the new OdbcMetaDataColumnNamesTest,
OleDbMetaDataCollectionNamesTest and SqlClientMetaDataCollectionNamesTest.
In class/System.Data/System.Data.Odbc:
* OdbcMetaDataCollectionNames.cs: Set the field values.
In class/System.Data/System.Data.OleDb:
* OleDbMetaDataCollectionNames.cs: New.
In class/System.Data/System.Data.SqlClient:
* SqlClientMetaDataCollectionNames.cs: Set the field values.
In class/System.Data/Test/System.Data.Odbc:
* OdbcMetaDataCollectionNamesTest.cs: New.
In class/System.Data/Test/System.Data.OleDb:
* OleDbMetaDataCollectionNamesTest.cs: New.
In class/System.Data/Test/System.Data.SqlClient:
* SqlClientMetaDataCollectionNamesTest.cs: New.
svn path=/trunk/mcs/; revision=97175
exception message for invalid DateTimeMode value to match MS. Code
formatting.
* DbDataPermissionAttribute.cs: In KeyRestrictionBehavior, reuse
ExceptionHelper.CheckEnumValue.
* ExceptionHelper.cs: Use same exception message for both 1.0 and 2.0.
* Index.cs: Fixed compiler warnings. Code formatting.
* SqlCommand.cs: Use ExceptionHelper.CheckEnumValue for enum checks.
* OleDbCommand.cs: Use ExceptionHelper.CheckEnumValue for enum checks.
* DBDataPermissionAttributeTest.cs: Improved test for invalid
KeyRestrictionBehavior. Fixed line endings.
* DataColumnTest.cs: No longer derive from deprecated Assertion class.
Code formatting. Added test for DateTimeMode.
svn path=/trunk/mcs/; revision=87866
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
In IsolationLevel, throw IOE if transaction is no longer open.
* SqlTransaction.cs: Clear connection in commit. In IsolationLevel,
throw IOE if transaction is no longer open.
* OleDbTransaction.cs: Clear connection in Commit and Rollback. In
IsolationLevel and Begin overloads, throw IOE if transaction is no
longer open.
svn path=/trunk/mcs/; revision=87836