If you use a stored procedure or a prepared statement, with
CommantType.StoredProcedure the ar variable is not set as the result of
onnection.Tds.BeginExecuteProcedure().
** Fixes#561667
* SqlCommand.cs (Dispose): While Disposing, set connection's
datareader to null so the connection can be reused with another datareader.
CloseConnection behavior.
* SqlCommand.cs: Ensure connection is closed if CloseConnection
behavior is set, and reader could not be created.
svn path=/trunk/mcs/; revision=138854
* 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
* 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
* 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
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
* SqlCommand.cs, SqlDataReader.cs, SqlConnection.cs: When the
server resets the connection, now the client code also disconnects
the session and remove the instance from pool. Fixes bug # 81933.
svn path=/trunk/mcs/; revision=83522
* SqlCommand.cs (Transaction, Connection): IDbCommand Transaction
and Connection can be set to null. Fixes bug 82189.
svn path=/trunk/mcs/; revision=83059
* SqlClientFactory.cs: Use SqlDataSourceEnumerator from S.D.Sql and
marked method todo. Avoid unnessary casts. Code formatting.
* SqlCommand.cs: Explicit interface implementation of IDbCommand not
necessary on 2.0 profile. Fixes API mismatches. Avoid unnecessary
casts. Code formatting.
* SqlConnection.cs: Also use RecommendAsConfigurable instead of
SettingBindableAttribute on 2.0. Use StateChange event from base class
on 2.0. Only explicitly implement IDbConnection methods on 1.0, since
these are implemented by base class on 2.0 profile. Removed extra
explicit implementation of IDisposable since the base class implements
this. Code formatting.
* SqlDataAdapter.cs: Dispose (bool) override not necessary on 2.0
profile. Stubbed ICloneable.Clone. Fixes API mismatches.
* SqlDataReader.cs: On 2.0, IDisposable.Dispose is implemented by
DbDataReader. Only 1.0 profile, explicitly implemented IEnumerable
GetEnumerator. Code formatting.
* SqlDataSourceEnumerator.cs: Removed.
* SQLDebugging.cs: Marked sealed on 2.0. Code formatting.
* SqlNotificationAuthType.cs: Removed.
* SqlNotificationInfo.cs: Added missing fields. Code formatting.
* SqlNotificationSource.cs: Added missing fields. Code formatting.
* SqlNotificationTransports.cs: Removed.
* SqlNotificationType.cs: Added missing Unknown field. Code formatting.
* SqlParameter.cs: Removed Browsable and EditorBrowsable attributes
from Precision and Scale. Fixes API mismatches. Code formatting fixes.
* SqlTransaction.cs: On 2.0 profile, Dispose method is exposed by
base class. Fixes API mismatches. Code formatting fixes.
* System.Data.dll.sources: Removed ISqlNotificationReceiver.cs,
SqlDataSourceEnumerator.cs, SqlNotificationAuthType.cs,
SqlNotificationTransports.cs.
svn path=/trunk/mcs/; revision=81134
* SqlCommand.cs, SqlConnectionStringBuilder.cs, SqlConnection.cs:
Fixed 1.0 and 2.0 extras, errors as stated in class status page.
* SqlDataAdapter.cs, SqlParameter.cs:Fixed 1.0 and 2.0 extras,
errors as stated in class status page.
* SqlBulkCopyColumnMappingCollection.cs: Fixed 1.0 and 2.0 extras,
errors as stated in class status page.
svn path=/trunk/mcs/; revision=78717
* SqlParameter.cs (SqlParameter): Updated constructor to use the
new TDS RPC implementation.
Fixed missing attributes.
(SetDbType): Added new case for sql_variant type.
(ConvertToFrameworkType): Implemented new private method to
convert the data type to framework type.
* SqlParameterCollection.cs: Fixed missing attributes and
implemented missing methods.
* SqlConnection.cs: Fixed missing attributes.
* SqlConnectionStringBuilder.cs: Certain attributes are missing or
its value or they are not appropriate. Fixed them.
* SqlDataReader.cs (GetData): Method is available only under 1.0
profile.
* SqlCommandBuilder.cs: Certain attributes are available only
under 2.0 profile, so moved them inside ifdef.
* SqlCommand.cs: Certain attributes are available only under 2.0
profile, so moved them inside ifdef.
svn path=/trunk/mcs/; revision=78186
* SqlClientFactory.cs: Added two using directives.
(CreateConnectionStringBuilder): Implemented the method.
(CreatePermission): Implemented the property.
* SqlCommand.cs: Added one using directive.
(Clone): Implemented the method.
(Dispose): Implemented the method.
(BeginExecuteXmlReader): Implemented the method.
* SqlCommandBuilder.cs (QuoteIdentifier): Implemented the method.
(UnquoteIdentifier): Implemented the method.
* SqlConnection.cs (ChangePassword): Implemented the method.
2007-03-19 Nidhi Rawal <[email protected]>
* SqlClientFactory.cs (CanCreateDataSourceEnumerator): Implemented
the property.
* SqlCommand.cs (Notification): Implemented the property.
(NotificationAutoEnlist): Implemented the property.
* SqlDataReader.cs (VisibleFieldCount): Implemented the property.
* SqlConnectionStringBuilder.cs (TrustServerCertificate): Implemented
the property.
(TypeSystemVersion): Implemented the property.
(UserInstance): Implemented the property.
(ContextConnection): Implemented the property.
* SqlConnection.cs (FireInfoMessageEventOnUserErrors): Implemented
the property.
(StatisticsEnabled): Implemented the property.
* SqlDataAdapter.cs (UpdateBatchSize): Implemented the property.
* SqlParameter.cs: Implemented one attribute.
svn path=/trunk/mcs/; revision=75189
* SqlParameter.cs: Move isVariableSizeType flag to TdsMetaParameter
so that the TdsMetaParameter can validate itself for valid size / values.
* SqlCommand.cs (Execute): Call Validate on TdsMetaParameter.
* TdsMetaParameter.cs: Add Validate() method. For now, validate
size/value. Add isVariableSizeType.
* SqlCommandTest.cs: Add OutputParamSizeTest1-4 to test size/value
validation exception.
svn path=/trunk/mcs/; revision=74500
* SqlCommand.cs (CommandType): Exception type thrown in 2.0
profile is different than 1.0, ArgumentOutOfRangeException.
(Connection): Exception type thrown in 2.0 profile is different
than 1.0, ArgumentOutOfRangeException.
(Execute): If Size property is 0 for String and Binary type, then
throw InvalidOperationException.
(ValidateCommand): Exception type thrown in 2.0 profile is
different than 1.0, NullReferenceException.
svn path=/trunk/mcs/; revision=74232
* SqlCommand.cs (ExecuteScalar): Fix returned value for
stored procedure calls to return the first column of the
first row produced by the proc.
* SqlCommandTest.cs: Add parameterized stored procedure call tests
to ExecuteScalar and ExecuteNonQuery.
svn path=/trunk/mcs/; revision=73982
implement support for return of output values in the parameter
collection.
2007-03-07 Andreia Gaita <[email protected]>
svn path=/trunk/mcs/; revision=73914
* SqlParameter.cs (CompareInfo): Implemented the property
CompareInfo.
2007-02-15 Nidhi Rawal <[email protected]>
* SqlCommand.cs: Added some attributes which were not implemented
for .NET 2.0 and removed extra attribute which are not there in
.NET 2.0.
* SqlCommandBuilder.cs: Added some attributes that were not
implemented for .NET 2.0.
* SqlParameterCollection.cs: Added some attributes that were
not implemented for .NET 2.0.
* SqlConnectionStringBuilder.cs: Added some attributes that
were not implemented for .NET 2.0.
* SqlConnection.cs: Added attribute that was not implemented
for .NET 2.0.
* SqlParameter.cs: Added some attributes which were not
implemented for .NET 2.0 and removed some extra attributes which
are not there in .NET 2.0
svn path=/trunk/mcs/; revision=73144
* SqlTransaction.cs (Dispose): Fixed compliation warning.
* SqlDataReader.cs (GetValues): Length of elements to be copied was
decided based on the argument array passed, which caused a bug, if
the length of given array is more than actual column values.
* SqlCommandBuilder.cs (CatalogSeparator, SchemaSeparator)
(CatalogLocation): Implemented missing properties.
(CreateDeleteCommand, CreateInsertCommand, CreateUpdateCommand):
Modified private methods to take bool flag. If true, add actual
parameter name instead of p1, p2 etc.
(CreateParameter): Added overloaded private method to create
parameter with the actual column name.
(GetUpdateCommand, GetDeleteCommand, GetInsertCommand):
Implemented missing overloaded methods.
(SetRowUpdatingHandler): Implemented missing protected method.
* SqlCommand.cs: Fixed compilation warning. Removed bogus
MonoTODO's.
svn path=/trunk/mcs/; revision=70619
* SqlCommand.cs (Execute): If sql2 length is greater than 0, then
add ';' and the respective sql2 string and then execute the
string. Fixes bug # 79880.
svn path=/trunk/mcs/; revision=69019
* Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds.cs :
- GetSequentialColumn,BeginLoad, EndLoad,
LoadData, SkipRow, SkipToColumnIndex
New Methods to Support sequential loading of row data
* Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsComm.cs :
- Skip : Changed arugment type from int to long.
* System.Data/Test/ProviderTests/System.Data.SqlClient/SqlDataReaderTest.cs :
Added more tests to verify Sequential reading of row data.
* System.Data/Test/ProviderTests/ProviderIndependant/DataReaderTest : Corrected a failing testcase.
* System.Data/System.Data.SqlClient/SqlDataReader.cs :
- GetBytes : Read binary/blob/clob data sequentially when
CommandBehavior is set to SequentialAcccess
- GetChars : Read String/clob data sequentially when CommandBehavior
is set to SequentialAccess
* System.Data/System.Data.SqlClient/SqlCommand.cs :
- ExecuteReader : set SequentialAccess property on TDS
- CloseDataReader : Reset the command behavior
svn path=/trunk/mcs/; revision=56757
* 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
* Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds.cs :
- Added a virtual method IsValidRowCount ()
- Modified the way RecordsAffected is being counted
* Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds70.cs :
- Overrode IsValidRowCount(), to check if the rowcount
returned by sqlserver is valid.
* System.Data/Test/ProviderTests/System.Data.SqlClient/SqlCommandTest.cs :
- Added Testcase for bug #75698
* System.Data/System.Data.SqlClient/SqlCommand.cs
* System.Data/System.Data.SqlClient/SqlDataReader.cs :
-Made changes so that the number of rows affected can be got directly
from Tds regardsless of the type of query.Fixes bug #75698
svn path=/trunk/mcs/; revision=52268