Commit Graph
220 Commits
Author SHA1 Message Date
vvaradhan ceefad76f1 2010-10-01 Veerapuram Varadhan <[email protected]>
** Fixes #561667
	* SqlCommand.cs (Dispose): While Disposing, set connection's
	datareader to null so the connection can be reused with another datareader.
2010-10-04 15:27:52 +05:30
vvaradhan 5b5d0dc864 2010-07-28 Veerapuram Varadhan <[email protected]>
** Fixes #584833
	* SqlCommand.cs (DeriveParameters): Support procedure name
	nomenclature of the form <database>.<user>.<procname> .
2010-07-28 12:52:03 +05:30
Veerapuram Varadhan e394c58e7b 2010-06-15 Veerapuram Varadhan <[email protected]>
** Fixes #613087
	* Tds.cs (ProcessLoginAck): Fix server version being compared in
	the switch-case.
	* Tds70.cs (BuildPreparedParameters, BuildProcedureCall): Set
	* default
	precision to 18 as used by MS.Net when connecting to SqlServer
7.0.
	(BuildExec, ExecRPC): Marked protected in order to be used by
Tds80
	and henceforth.
	* Tds80.cs (Execute): Separated from Tds70 to include Tds80
	* changes.

svn path=/trunk/mcs/; revision=158951
2010-06-15 16:12:36 +00:00
Veerapuram Varadhan 7c38ba4b7c 2010-03-26 Veerapuram Varadhan <[email protected]>
** Fixes #564833/580736
    * DbDataAdapter.cs (*Command): Fix for .NET compatibility which
    supports both type of adapters with/without discrete command
    instances.

svn path=/trunk/mcs/; revision=154270
2010-03-26 13:45:38 +00:00
Jonathan Pobst 86ecfaab9f 2009-12-03 Jonathan Pobst <[email protected]>
* SortOrder.cs: Add enum.

2009-12-03  Jonathan Pobst  <[email protected]>

	* System.Data.dll.sources: Add SortOrder.cs.

svn path=/trunk/mcs/; revision=147636
2009-12-04 02:22:23 +00:00
Veerapuram Varadhan bba7b6a6f7 2009-10-28 Veerapuram Varadhan <[email protected]>
** Fixes #385028/#385029
	* DbCommandBuilder.cs (CreateInsertCommand): Workaround for inserting
	DEFAULT values to non-null-columns.
	(GetInsertCommand): New overload added to handle above workaround.
	(set_DataAdapter): Register for the RowUpdatingEventHandlers.

svn path=/trunk/mcs/; revision=144915
2009-10-27 20:18:37 +00:00
Jonathan Pryor 0dd3c5f987 * Makefile: Add Mono.Data.Tds, System.Transactions, System.Data, and
Mono.Data.Sqlite to the MonoTouch build.
	* System/System.ComponentModel/TypeConverter_2_1.cs: Skip this type in
		the MonoTouch profile; MonoTouch will be using the 2.0 version of 
		TypeConverter.
	* System/System.ComponentModel/ComponentCollection.cs, 
		System/System.ComponentModel/PropertyDescriptor.cs: MonoTouch uses the
		.NET 2.0 versions of these types.
	* System/monotouch_System.dll.sources: Add lots of additional .NET 2.0
		functionality to the MonoTouch profile.
	* System.Transactions/Makefile (VALID_PROFILE): Add monotouch.
	* System.Data/System.Data.Common/DbConnection.cs: Throw 
		NotImplementedException for DbConnection.DbProviderFactory, as 
		DbProviderFactories isn't included in the MonoTouch profile.
	* System.Data/System.Data.SqlClient/SqlConnection.cs: Remove 
		EnterpriseServices dependency from the MonoTouch profile.
	* System.Data/monotouch_System.Data.dll.sources: Added.
	* System.Data/System.Data/XmlSchemaDataImporter.cs: Remove 
		DbProviderFactories dependency in the MonoTouch profile.

svn path=/trunk/mcs/; revision=144150
2009-10-14 20:55:43 +00:00
Veerapuram Varadhan 1aea1446a7 2009-08-17 Veerapuram Varadhan <[email protected]>
** Fixes #525306
	* SqlConnection.cs (Open): Use Tds80 also in case of non-pooling
	connections.

svn path=/trunk/mcs/; revision=140086
2009-08-17 17:24:22 +00:00
Gert Driesen fd94203d2e * SqlParameter.cs (ConvertToFrameworkType): Only wrap FormatException
on 2.0 profile.

svn path=/trunk/mcs/; revision=139241
2009-08-01 13:01:05 +00:00
Gert Driesen 594407eb88 * SqlParameter.cs: Modified ConvertToFrameworkType to only perform
conversion if type of value is different from "system type". Make
DbTypeMapping hashtable available on 1.0 profile, and add missing
mappings. Wrap FormatException adding information on conversion
that failed.
* SqlParameterTest.cs: Added test for bug #526794, and failed
conversion from (zero-length) string to int. Changed spaces to tabs.

svn path=/trunk/mcs/; revision=139116
2009-07-30 19:42:59 +00:00
Veerapuram Varadhan e08e9acfcc 1.x build fix
svn path=/trunk/mcs/; revision=139098
2009-07-30 16:57:47 +00:00
Veerapuram Varadhan 302d82e42d 2009-07-30 Veerapuram Varadhan <[email protected]>
** Fixes the issue reported by Scott <[email protected]> in Mono-list
	* SqlParameter.cs (ConvertToFrameworkType): Return String.Empty
	in case of zero-length strings.

svn path=/trunk/mcs/; revision=139086
2009-07-30 14:32:52 +00:00
Veerapuram Varadhan 6a4a2997d8 2009-07-30 Veerapuram Varadhan <[email protected]>
* SqlDataAdapter.cs (IDbDataAdapter.*Command): Remove over-engineered
	checks as the base implementation is changed.

svn path=/trunk/mcs/; revision=139080
2009-07-30 13:41:31 +00:00
Veerapuram Varadhan 543d5aad8e Conflict merge between trunk/local tree
svn path=/trunk/mcs/; revision=139072
2009-07-30 12:38:11 +00:00
Veerapuram Varadhan d3e0a1b198 2009-07-26 Veerapuram Varadhan <[email protected]>
* SqlParameter.cs (get/set_SqlValue, GetSqlValue): Return the appropriately
	SQL-typed param value.  Fixes failing provider tests.

svn path=/trunk/mcs/; revision=139066
2009-07-30 12:36:37 +00:00
Veerapuram Varadhan 8d5211d815 conflict fix between trunk and local tree
svn path=/trunk/mcs/; revision=139063
2009-07-30 12:35:52 +00:00
Veerapuram Varadhan bb222be3f8 2009-07-25 Veerapuram Varadhan <[email protected]>
* SqlDataReader.cs: Added new schema fields to the schema row.
	Fixes a failing provider test.

svn path=/trunk/mcs/; revision=139062
2009-07-30 12:35:33 +00:00
Veerapuram Varadhan cee0485905 2009-07-25 Veerapuram Varadhan <[email protected]>
* Fixes #507663
	* SqlCommandBuilder.cs: From 2.0 onwards, use base's
	implementation for handling auto-generated commands.
	* SqlDataAdapter.cs: -- ditto --

svn path=/trunk/mcs/; revision=139061
2009-07-30 12:35:12 +00:00
Gert Driesen 1925fbede7 * SqlCommandTest.cs: Improved test for invalid statement to cover
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
2009-07-28 17:24:35 +00:00
Gert Driesen 5cc9f25881 * SqlParameter.cs: Improved support for SqlValue and SqlTypes.
* SqlParameterTest.cs: Added/improved tests for SqlValue, and
SqlTypes. Improved tests for char and char [] type inferrence.

svn path=/trunk/mcs/; revision=138699
2009-07-26 19:53:09 +00:00
Veerapuram Varadhan 46cdbd98ec * Utility changes to convert between DbType/SqlDbType/System.Type
svn path=/trunk/mcs/; revision=138434
2009-07-22 18:24:13 +00:00
Veerapuram Varadhan 42e15fecc5 Update: included patch contributor's info
svn path=/trunk/mcs/; revision=133770
2009-05-08 14:10:33 +00:00
Veerapuram Varadhan 781cb47467 2009-05-08 Veerapuram Varadhan <[email protected]>
** Fixes #497715
	* SqlDataReader.cs: (GetSqlXml): Handle Xml types for TDS 8/8.1
	clients as well.
	* SqlParameter.cs: Map XML type properly.

svn path=/trunk/mcs/; revision=133769
2009-05-08 14:10:18 +00:00
Gonzalo Paniagua Javier 181d483558 2009-04-28 Gonzalo Paniagua Javier <[email protected]>
* SqlConnection.cs: if the error causes a disconnection from the
	server, close the data stream.


svn path=/trunk/mcs/; revision=132942
2009-04-29 02:54:36 +00:00
Veerapuram Varadhan f71d07b3df Properly handle TDS 8 BigInt type
Proper handling of TDS 8 BigInt type

svn path=/trunk/mcs/; revision=130081
2009-03-23 19:33:59 +00:00
Veerapuram Varadhan e62e0f62e5 TDS 8 changes
svn path=/trunk/mcs/; revision=125321
2009-02-02 09:13:24 +00:00
Gonzalo Paniagua Javier c0ac3b7e2d Improved TDS connection pooling
svn path=/trunk/mcs/; revision=124408
2009-01-24 05:55:52 +00:00
Gert Driesen 0a1a4828a1 * SqlParameter.cs: Renamed isDirty to typeChanged; it is now now only
used to indicate whether the type of the parameter has been updated.
Changed signature of 'updated' argument in GetFrameworkValue to ref
to match delegate in Mono.Data.Tds, and convert value if either the
type has been changed or if the 'updated' argument is true (which -
for now - means the value or size changed in TdsMetaParameter).
Various fixes for derived parameters:
- parameter_type 2 means InputOutput parameter, while 3 means Output;
- Only set precision and scale is type is decimal.
- When type has variable size, then also set Size.

svn path=/trunk/mcs/; revision=123705
2009-01-17 20:12:24 +00:00
Gert Driesen e3c0d4579c * SqlDataReader.cs: Added GetSchemaRowDbType overload for
getting sql type of a given column (identified using its
ordinal). Modified GetBytes to throw SqlNullValueException
(2.0 profile) or return 0 (1.0 profile) when reading bytes
sequentially. Added support for non-sequentially reading
text and ntext columns using GetBytes. Modified GetChar
to throw a NotSupportedException to match MS.

svn path=/trunk/mcs/; revision=122396
2009-01-04 21:38:09 +00:00
Gert Driesen e9afd5d74d * SqlCommandBuilder.cs (RefreshSchema): Clear commands.
svn path=/trunk/mcs/; revision=122395
2009-01-04 20:55:09 +00:00
Gert Driesen 1e50a2325f * SqlDataReader.cs: Removed unused dataTypeNames, and
unnecessary initializations. Added missing reader state
and row state checks. Fixed implementation of HasRows.
Modified type of DataType to object on 1.0 profile for
compatibility with .NET 1.x. Do not mark (Big)VarBinary
or ((Big)Binary as long, as unit tests show that IsLong
is for wide (unicode) data types. Fixed type data for
SmallDateTime and SmallMoney data types. Improved support
for bigint data type (using TDS 7.0).

svn path=/trunk/mcs/; revision=122381
2009-01-03 23:07:06 +00:00
Gert Driesen 55a3f19733 * SqlCommand.cs: Moved connection reset before the throw.
Improved exception message.

svn path=/trunk/mcs/; revision=122380
2009-01-03 22:59:29 +00:00
Gert Driesen 9ec8751239 * SqlCommandBuilder.cs: Only set SourceColumn for null check
parameters on the 2.0 profile, and set SourceVersion to
Current on 1.0 profile. Changed accessibility of RefreshSchema
to public, and do not immediately create commands. Removed
CWL.

svn path=/trunk/mcs/; revision=122379
2009-01-03 22:55:09 +00:00
Gert Driesen 83cff6650f * SqlParameter.cs: When setting ParameterName or sourceName to
null, use a zero-length string instead. On 1.0 profile, only
infer type from value if value is not null or DBNull. Store
raw value in TdsMetadataParameter, and use delegate to convert
it to framework type (when necessary). Improve implementation
of SqlValue (still needs lots of work).

svn path=/trunk/mcs/; revision=122376
2009-01-03 22:40:34 +00:00
Gert Driesen 13b9781926 * System.Data_test.dll.sources: Added SqlCommandBuilderTest.cs
and SqlParameterTest.cs.
* DbCommandBuilder.cs (QuoteIdentifier): Throw NotSupportedException.
* DbDataAdapter.cs (Update): Add row causing concurrency violation
to DBConcurrencyException.
* OdbcCommandBuilder.cs (QuoteIdentifier): Escape QuoteSuffix
character(s) in unquoted identifier.
* SqlCommandBuilder.cs: Added missing checks for QuotePrefix and
QuoteSuffix on 2.0 profile, and return a zero-length string if
not set (or set to null) on 1.0 profile. Do not allow the value
of CatalogSeparator and SchemaSeparator to be changed from '.'.
Modified generated SQL to match MS. Added implementation for
QuoteIdenfifier. Modified parameters to match MS.
* SqlParameter.cs (SqlValue): Keep Value in sync.
* DbCommandBuilderTest.cs: Added test for QuoteIdentifier.
* OdbcCommandBuilderTest.cs: Enabled test for QuoteIdentifier.
* SqlCommandBuilderTest.cs: Added tests for CatalogLocation,
CatalogSeparator, ConflictOption, QuoteIdentifier, QuotePrefix,
QuoteSuffix  and SchemaSeparator.
* SqlParameterTest.cs: Moved existing tests from ProviderTests
to increase their visibility. Added tests for type inference.

svn path=/trunk/mcs/; revision=122361
2009-01-03 14:24:15 +00:00
Gonzalo Paniagua Javier 366a8838ab 2008-12-20 Gonzalo Paniagua Javier <[email protected]>
* SqlParameter.cs: I removed these 2 lines I added 2 patches ago in
	the previous patch...



svn path=/trunk/mcs/; revision=121937
2008-12-20 20:47:47 +00:00
Gonzalo Paniagua Javier 1bced9acdb 2008-12-20 Gonzalo Paniagua Javier <[email protected]>
* SqlConnection.cs: close the connection on error.


svn path=/trunk/mcs/; revision=121920
2008-12-20 08:53:16 +00:00
Gonzalo Paniagua Javier 8c8c3c6bec 2008-12-16 Gonzalo Paniagua Javier <[email protected]>
* SqlParameter.cs: don't allocate error strings until the error
	actually happens. Compare types instead of strings. Use a Hashtable
	for type mappings.


svn path=/trunk/mcs/; revision=121605
2008-12-16 15:43:29 +00:00
Gonzalo Paniagua Javier c8ebfe25f1 2008-12-12 Gonzalo Paniagua Javier <[email protected]>
* SqlParameter.cs: use the underlying type when inferring the type for
	enumerations.


svn path=/trunk/mcs/; revision=121485
2008-12-13 01:51:41 +00:00
Veerapuram Varadhan 004f5ad90c Reset the connection on timeout exception before reusing it
svn path=/trunk/mcs/; revision=118727
2008-11-13 17:01:23 +00:00
Gert Driesen cd1071406b * SqlConnection.cs (ClearPool): Added null check.
* SqlConnectionTest.cs: Added test for null check in ClearPool.

svn path=/trunk/mcs/; revision=118309
2008-11-09 14:01:56 +00:00
Gert Driesen 82dd9fc53c * TdsConnectionPool.cs: Added TdsConnectionPoolManager.GetConnection
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
2008-11-09 13:36:37 +00:00
Veerapuram Varadhan efe5bd6fb8 * SqlDataReader.cs (GetSqlXml): Handle the scenario when Sql Server 2005
returns Xml column type as NTEXT when called from clients that use <
  TDS 8.0 protocol.


svn path=/trunk/mcs/; revision=114482
2008-09-30 14:01:22 +00:00
Veerapuram Varadhan efb49f7684 Simplification of if-else part
svn path=/trunk/mcs/; revision=113639
2008-09-20 18:54:17 +00:00
Veerapuram Varadhan 866542814b Handle no brackets scenario
svn path=/trunk/mcs/; revision=113637
2008-09-20 18:08:20 +00:00
Veerapuram Varadhan ad382304b1 Escape/trim schema/procedure names before passing them as parameter
values in DeriveParameters.


svn path=/trunk/mcs/; revision=113327
2008-09-17 16:53:59 +00:00
Atsushi Eno d89ecdf8a2 2008-09-13 Atsushi Enomoto <[email protected]>
* SqlDependency.cs : wrong namespace.


svn path=/trunk/mcs/; revision=112931
2008-09-13 12:37:21 +00:00
Gert Driesen 9fb7f7aad0 * SqlConnection.cs: Use constants for min/max values. When value is
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
2008-08-14 11:12:49 +00:00
Gert Driesen 1f9160fe78 * SqlConnection.cs: Convert keywords to lowercase instead of uppercase
to avoid further case changes in exception messages.

svn path=/trunk/mcs/; revision=110468
2008-08-14 11:02:54 +00:00
Gert Driesen ce5f523da5 * SqlCommandTest.cs: Enabled test for bug #412569.
* SqlCommand.cs (ExecuteReader): When behavior includes SingleRow,
then only return a single result. Fixes bug #412569.

svn path=/trunk/mcs/; revision=109065
2008-07-28 19:01:02 +00:00