Commit Graph
366 Commits
Author SHA1 Message Date
Neale Ferguson a83e9cf4aa Add SqlCredential support -
- Tds.cs: Use SecureString objects for passwords; Add method to retrieve string from SecureString
- Tds42.cs: Use SecureString for passwords
- Tds50.cs: Use SecureString for passwords
- Tds70.cs: Use SecureString for passwords
- TdsConnectionParameters.cs: Use SecureString for passwords; Initialize Password parameter as cleared string; Add indicator for when password is set
- SqlConnection.cs: Use SecureString for passwords; Add SqlConnect method that accepts an SqlCredential along with the Connection string; Perform checking of parameters to ensure user/password not specified in connection string if credentials have been specified or using credentials when domain login is specified.
- SqlCredential.cs: Add new class with support for credentials
- System.Data.dll.sources: Add SqlCredential.cs to the build list
2014-09-19 11:52:52 -04:00
Neale Ferguson 0b078d3e36 Support the datetime2 parameter type 2014-05-02 16:39:24 -04:00
Miguel de Icaza b57fcaa28b Merge pull request #778 from cmorris98/master
SqlBulkCopy Implementation
2014-02-12 15:25:59 -05:00
Craig Morris e5a83e6857 SqlBulkCopy Implementation
This are the code changes to get the SqlBulkCopy procedure working on
mono.
2013-11-27 11:11:11 -07:00
Maxime Brugidou a02d0c2e9a [Bug 16186] SqlCommand.BeginExecuteInternal fix
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().
2013-11-15 13:14:08 +01:00
Andres G. Aragoneses 5b1748a00a [System.Data.SqlClient] Use DEFAULT_CONNECTIONLIFETIME const in the code
We had created the constant for the pull request but we were not actually
using it, oops!
2012-12-19 11:08:47 +00:00
James Lewis 859d71d005 [System.Data.SqlClient] Support for "Connection Lifetime" parameter
Adding support for "Connection Lifetime" parameter in connection strings.
This is especially fundamental in this scenario:
- Pooling is ON because the app is in constant reception of requests.
- Loadbalancer is switched to point to a new database.
- Mono needs to discard the connections that are too old (marked by lifetime)
in order to create new ones, that will connect to the new DB.

It includes a unit test in Mono.Data.Tds testing assembly.

Patch contributed under the terms by the X11/MIT license, by:
 James Lewis <[email protected]>
 Andres G. Aragoneses <[email protected]>
2012-12-05 12:29:41 +00:00
Marek Safar 86b142e32e Implement SqlConnection.DbProviderFactory. Fixes #7936 2012-11-01 17:55:59 +01:00
Marek Safar 43d5e753ef Revert "Fixes 4010. After working with Microsoft SQL Server experts it turns out we were able to drive so many packets to the server we were causing it grief. By increasing the packet level size this problem disappears."
This breaks .net compatibility and probably just hides underlying problem

This reverts commit 8c26404371.
2012-08-13 10:55:23 +01:00
Neale Ferguson 8c26404371 Fixes 4010. After working with Microsoft SQL Server experts it turns out we were able to drive so many packets to the server we were causing it grief. By increasing the packet level size this problem disappears. 2012-08-09 12:12:53 -04:00
Marek Safar 1c65c12f19 Add some missing methods 2012-07-27 08:54:03 +01:00
Marek Safar 3184c9ee65 Clean up old defines 2012-07-27 08:25:38 +01:00
Miguel de Icaza ae0feab435 Removal of NET_1_1 defines and some NET_2_0; Both defines are true these days in Mono, no versions prior to 2.0 are supported 2012-06-01 18:04:24 -04:00
Miguel de Icaza 8d3b80d4fb [net_1_0] Finally all of NET_1_0 is gone from the source files 2012-06-01 16:50:55 -04:00
Miguel de Icaza 7afc0e951d SqlBulkCopy.WriteToServer: Check array length before accessing first element; Patch from damoxc/github.com 2012-03-19 11:53:10 -04:00
Miguel de Icaza ea978eba81 Fix my last commit 2012-01-19 00:08:31 -05:00
Miguel de Icaza 30ae1f0cbf Prevent race conditions for this cached variable, by using a temporary variable, fixes #2952 2012-01-18 11:18:51 -05:00
Marek Safar 15af51806d Merge pull request #214 from QuickJack/cd2c570c5543963d987f51080218715407c5d4b9
Fixes 2 problems in Mono's configuration stack.
2012-01-11 11:27:25 -08:00
QuickJack 2060853826 Fixes some warnings in System.Data.dll 2011-12-27 19:16:04 +01:00
Neale Ferguson 8d1d2af8bd TdsMetaParameter.cs - fixes 699643. Note as Mono.Data.TdsClient and Mono.Data.SybaseClient have both been removed from mono, support for pre 7.0 version of SQL Server isn't required so this should not break applications.
SqlTransaction.cs - Check if the connection is still active before trying to rollback during Dispose. A loss of a connection is possible which result in an exception that will lead to the closing of the session. This will result in the dispose methods being invoked and if there was an active transaction then a rollback will be attempted. However, if the connection is gone we'll end up raising further exceptions about resources already being disposed.
2011-12-12 09:51:27 -05:00
Oleg Petrov d42b30f679 Behaviour for most of SqlBulkCopyOptions was implemented. 2011-12-12 02:35:22 +04:00
Oleg Petrov 16fa1a19a2 Comments for SqlBulkCopyOptions enum describes expected behaviour 2011-12-04 13:12:56 +04:00
Oleg Petrov 7ab21da462 Not null checks for ctors 2011-12-03 16:17:08 +04:00
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
Jb Evain 432d531126 Enable the System.Data build for monodroid 2010-09-08 18:48:29 +02:00
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 d1dd7697ac 2009-07-29 Veerapuram Varadhan <[email protected]>
* SqlDataAdapter.cs (IDbDataAdapter.*Command): Revert some of my earlier
	changes.  Validate the incoming value as we use bases' implementation now.
	Fixes failing tests.

	* SqlParameter.cs (GetSqlValue): Simplify handling of SqlValue and SqlTypes.
	(SqlTypeToFramworkType): Added support for SqlChars and SqlBytes types.

svn path=/trunk/mcs/; revision=139070
2009-07-30 12:37:44 +00:00
Veerapuram Varadhan f866c62874 2009-07-28 Gert Driesen <[email protected]>
* More clean up of fix for #522624/#507663
	* SqlCommandBuilder.cs: Appropriately handle rowUpdatingHandler and
	more cleanup for 2.0 profile.

svn path=/trunk/mcs/; revision=139068
2009-07-30 12:37:15 +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