Imported Upstream version 4.0.0~alpha1

Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
Jo Shields
2015-04-07 09:35:12 +01:00
parent 283343f570
commit 3c1f479b9d
22469 changed files with 2931443 additions and 869343 deletions

View File

@@ -27,7 +27,6 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System;
using System.ComponentModel;
using System.Globalization;
@@ -62,4 +61,3 @@ namespace System.Data.SqlClient {
#endregion // Methods
}
}
#endif

View File

@@ -27,7 +27,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System;
@@ -35,4 +34,3 @@ namespace System.Data.SqlClient {
public delegate void OnChangeEventHandler(object sender, SqlNotificationEventArgs e);
}
#endif

View File

@@ -36,9 +36,7 @@ namespace System.Data.SqlClient
[GuidAttribute ("afef65ad-4577-447a-a148-83acadd3d4b9")]
[ClassInterface (ClassInterfaceType.None)]
public
#if NET_2_0
sealed
#endif
class SQLDebugging
{
[MonoTODO]

View File

@@ -31,7 +31,6 @@
//
#if NET_2_0
using System;
using System.Threading;
@@ -136,4 +135,3 @@ namespace System.Data.SqlClient
}
}
#endif // NET_2_0

View File

@@ -30,7 +30,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System;
using System.Net.Sockets;
@@ -53,4 +52,3 @@ namespace System.Data.SqlClient
}
}
}
#endif // NET_2_0

View File

@@ -28,7 +28,6 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System;
using System.Data;
@@ -623,4 +622,3 @@ namespace System.Data.SqlClient {
}
}
#endif

View File

@@ -28,7 +28,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
namespace System.Data.SqlClient
{
/// <summary>
@@ -135,4 +134,3 @@ namespace System.Data.SqlClient
}
}
#endif

View File

@@ -28,7 +28,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System;
using System.Data;
@@ -147,4 +146,3 @@ namespace System.Data.SqlClient
}
}
#endif

View File

@@ -27,7 +27,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
namespace System.Data.SqlClient
{
@@ -75,5 +74,4 @@ namespace System.Data.SqlClient
}
}
#endif

View File

@@ -28,7 +28,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
namespace System.Data.SqlClient
{
@@ -54,4 +53,3 @@ namespace System.Data.SqlClient
}
}
#endif

View File

@@ -44,9 +44,7 @@ using System.Collections.Specialized;
using System.ComponentModel;
using System.Data;
using System.Data.Common;
#if NET_2_0
using System.Data.Sql;
#endif
using System.Runtime.InteropServices;
using System.Text;
using System.Xml;
@@ -54,12 +52,8 @@ using System.Xml;
namespace System.Data.SqlClient {
[DesignerAttribute ("Microsoft.VSDesigner.Data.VS.SqlCommandDesigner, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.ComponentModel.Design.IDesigner")]
[ToolboxItemAttribute ("System.Drawing.Design.ToolboxItem, "+ Consts.AssemblySystem_Drawing)]
#if NET_2_0
[DefaultEventAttribute ("RecordsAffected")]
public sealed class SqlCommand : DbCommand, IDbCommand, ICloneable
#else
public sealed class SqlCommand : Component, IDbCommand, ICloneable
#endif // NET_2_0
{
#region Fields
@@ -75,11 +69,9 @@ namespace System.Data.SqlClient {
CommandBehavior behavior = CommandBehavior.Default;
SqlParameterCollection parameters;
string preparedStatement;
#if NET_2_0
bool disposed;
SqlNotificationRequest notification;
bool notificationAutoEnlist;
#endif
#endregion // Fields
@@ -109,9 +101,7 @@ namespace System.Data.SqlClient {
this.updatedRowSource = UpdateRowSource.Both;
this.commandTimeout = DEFAULT_COMMAND_TIMEOUT;
#if NET_2_0
notificationAutoEnlist = true;
#endif
designTimeVisible = true;
parameters = new SqlParameterCollection (this);
}
@@ -138,16 +128,11 @@ namespace System.Data.SqlClient {
get { return behavior; }
}
#if !NET_2_0
[DataSysDescription ("Command text to execute.")]
#endif
[DefaultValue ("")]
[EditorAttribute ("Microsoft.VSDesigner.Data.SQL.Design.SqlCommandTextEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing )]
[RefreshProperties (RefreshProperties.All)]
public
#if NET_2_0
override
#endif //NET_2_0
string CommandText {
get {
if (commandText == null)
@@ -161,47 +146,28 @@ namespace System.Data.SqlClient {
}
}
#if !NET_2_0
[DataSysDescription ("Time to wait for command to execute.")]
[DefaultValue (DEFAULT_COMMAND_TIMEOUT)]
#endif
public
#if NET_2_0
override
#endif //NET_2_0
int CommandTimeout {
get { return commandTimeout; }
set {
if (value < 0)
#if NET_2_0
throw new ArgumentException ("The property value assigned is less than 0.",
"CommandTimeout");
#else
throw new ArgumentException ("The property value assigned is less than 0.");
#endif
commandTimeout = value;
}
}
#if !NET_2_0
[DataSysDescription ("How to interpret the CommandText.")]
#endif
[DefaultValue (CommandType.Text)]
[RefreshProperties (RefreshProperties.All)]
public
#if NET_2_0
override
#endif //NET_2_0
CommandType CommandType {
get { return commandType; }
set {
if (value == CommandType.TableDirect)
#if NET_2_0
throw new ArgumentOutOfRangeException ("CommandType.TableDirect is not supported " +
"by the Mono SqlClient Data Provider.");
#else
throw new ArgumentException ("CommandType.TableDirect is not supported by the Mono SqlClient Data Provider.");
#endif
ExceptionHelper.CheckEnumValue (typeof (CommandType), value);
commandType = value;
@@ -209,22 +175,13 @@ namespace System.Data.SqlClient {
}
[DefaultValue (null)]
#if !NET_2_0
[DataSysDescription ("Connection used by the command.")]
#endif
[EditorAttribute ("Microsoft.VSDesigner.Data.Design.DbConnectionEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing )]
public
#if NET_2_0
new
#endif //NET_2_0
SqlConnection Connection {
get { return connection; }
set
{
#if ONLY_1_1
if (connection != null && connection.DataReader != null)
throw new InvalidOperationException ("The connection is busy fetching data.");
#endif
connection = value;
}
}
@@ -232,26 +189,17 @@ namespace System.Data.SqlClient {
[Browsable (false)]
[DefaultValue (true)]
[DesignOnly (true)]
#if NET_2_0
[EditorBrowsable (EditorBrowsableState.Never)]
#endif
public
#if NET_2_0
override
#endif //NET_2_0
bool DesignTimeVisible {
get { return designTimeVisible; }
set { designTimeVisible = value; }
}
#if !NET_2_0
[DataSysDescription ("The parameters collection.")]
#endif
[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
public
#if NET_2_0
new
#endif //NET_2_0
SqlParameterCollection Parameters {
get { return parameters; }
}
@@ -260,34 +208,8 @@ namespace System.Data.SqlClient {
get { return Connection.Tds; }
}
#if !NET_2_0
IDbConnection IDbCommand.Connection {
get { return Connection; }
set {
if (!(value == null || value is SqlConnection))
throw new InvalidCastException ("The value was not a valid SqlConnection.");
Connection = (SqlConnection) value;
}
}
IDataParameterCollection IDbCommand.Parameters {
get { return Parameters; }
}
IDbTransaction IDbCommand.Transaction {
get { return Transaction; }
set {
if (!(value == null || value is SqlTransaction))
throw new ArgumentException ();
Transaction = (SqlTransaction) value;
}
}
#endif
[Browsable (false)]
#if !NET_2_0
[DataSysDescription ("The transaction used by the command.")]
#endif
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
public new SqlTransaction Transaction {
get {
@@ -297,22 +219,13 @@ namespace System.Data.SqlClient {
}
set
{
#if ONLY_1_1
if (connection != null && connection.DataReader != null)
throw new InvalidOperationException ("The connection is busy fetching data.");
#endif
transaction = value;
}
}
#if !NET_2_0
[DataSysDescription ("When used by a DataAdapter.Update, how command results are applied to the current DataRow.")]
#endif
[DefaultValue (UpdateRowSource.Both)]
public
#if NET_2_0
override
#endif // NET_2_0
UpdateRowSource UpdatedRowSource {
get { return updatedRowSource; }
set {
@@ -321,7 +234,6 @@ namespace System.Data.SqlClient {
}
}
#if NET_2_0
[Browsable (false)]
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
public SqlNotificationRequest Notification {
@@ -334,15 +246,12 @@ namespace System.Data.SqlClient {
get { return notificationAutoEnlist; }
set { notificationAutoEnlist = value; }
}
#endif
#endregion // Fields
#region Methods
public
#if NET_2_0
override
#endif // NET_2_0
void Cancel ()
{
if (Connection == null || Connection.Tds == null)
@@ -350,12 +259,10 @@ namespace System.Data.SqlClient {
Connection.Tds.Cancel ();
}
#if NET_2_0
public SqlCommand Clone ()
{
return new SqlCommand (commandText, connection, transaction, commandType, updatedRowSource, designTimeVisible, commandTimeout, parameters);
}
#endif // NET_2_0
internal void CloseDataReader ()
{
@@ -558,9 +465,7 @@ namespace System.Data.SqlClient {
}
public
#if NET_2_0
override
#endif // NET_2_0
int ExecuteNonQuery ()
{
ValidateCommand ("ExecuteNonQuery", false);
@@ -604,18 +509,12 @@ namespace System.Data.SqlClient {
}
public
#if NET_2_0
override
#endif // NET_2_0
object ExecuteScalar ()
{
try {
object result = null;
#if NET_2_0
ValidateCommand ("ExecuteScalar", false);
#else
ValidateCommand ("ExecuteReader", false);
#endif
behavior = CommandBehavior.Default;
Execute (true);
@@ -683,24 +582,7 @@ namespace System.Data.SqlClient {
}
#if !NET_2_0
IDbDataParameter IDbCommand.CreateParameter ()
{
return CreateParameter ();
}
IDataReader IDbCommand.ExecuteReader ()
{
return ExecuteReader ();
}
IDataReader IDbCommand.ExecuteReader (CommandBehavior behavior)
{
return ExecuteReader (behavior);
}
#endif
#if NET_2_0
protected override void Dispose (bool disposing)
{
if (disposed) return;
@@ -712,18 +594,13 @@ namespace System.Data.SqlClient {
base.Dispose (disposing);
disposed = true;
}
#endif
public
#if NET_2_0
override
#endif // NET_2_0
void Prepare ()
{
#if NET_2_0
if (Connection == null)
throw new NullReferenceException ();
#endif
if (CommandType == CommandType.StoredProcedure || CommandType == CommandType.Text && Parameters.Count == 0)
return;
@@ -758,11 +635,7 @@ namespace System.Data.SqlClient {
if (Transaction == null && Connection.Transaction != null)
throw new InvalidOperationException (String.Format (
"{0} requires a transaction if the command's connection is in a pending transaction.",
#if NET_2_0
method));
#else
"Execute"));
#endif
if (Transaction != null && Transaction.Connection != Connection)
throw new InvalidOperationException ("The connection does not have the same transaction as the command.");
if (Connection.State != ConnectionState.Open)
@@ -773,15 +646,12 @@ namespace System.Data.SqlClient {
throw new InvalidOperationException ("There is already an open DataReader associated with this Connection which must be closed first.");
if (Connection.XmlReader != null)
throw new InvalidOperationException ("There is already an open XmlReader associated with this Connection which must be closed first.");
#if NET_2_0
if (async && !Connection.AsyncProcessing)
throw new InvalidOperationException ("This Connection object is not " +
"in Asynchronous mode. Use 'Asynchronous" +
" Processing = true' to set it.");
#endif // NET_2_0
}
#if NET_2_0
protected override DbParameter CreateDbParameter ()
{
return CreateParameter ();
@@ -805,11 +675,9 @@ namespace System.Data.SqlClient {
get { return Transaction; }
set { Transaction = (SqlTransaction) value; }
}
#endif // NET_2_0
#endregion // Methods
#if NET_2_0
#region Asynchronous Methods
internal IAsyncResult BeginExecuteInternal (CommandBehavior behavior,
@@ -1020,6 +888,5 @@ namespace System.Data.SqlClient {
#endregion // Asynchronous Methods
public event StatementCompletedEventHandler StatementCompleted;
#endif // NET_2_0
}
}

View File

@@ -53,19 +53,13 @@ using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Xml;
#if NET_2_0
using System.Collections.Generic;
#endif
using System.Security;
namespace System.Data.SqlClient
{
[DefaultEvent ("InfoMessage")]
#if NET_2_0
public sealed class SqlConnection : DbConnection, IDbConnection, ICloneable
#else
public sealed class SqlConnection : Component, IDbConnection, ICloneable
#endif // NET_2_0
{
#region Fields
@@ -73,13 +67,8 @@ namespace System.Data.SqlClient
// The set of SQL connection pools
static TdsConnectionPoolManager sqlConnectionPools = new TdsConnectionPoolManager (TdsVersion.tds80);
#if NET_2_0
const int DEFAULT_PACKETSIZE = 8000;
const int MAX_PACKETSIZE = 32768;
#else
const int DEFAULT_PACKETSIZE = 8192;
const int MAX_PACKETSIZE = 32767;
#endif
const int MIN_PACKETSIZE = 512;
const int DEFAULT_CONNECTIONTIMEOUT = 15;
const int DEFAULT_CONNECTIONLIFETIME = 0;
@@ -174,26 +163,16 @@ namespace System.Data.SqlClient
}
}
#if !NET_2_0
[DataSysDescription ("Current connection timeout value, 'Connect Timeout=X' in the ConnectionString.")]
#endif
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
public
#if NET_2_0
override
#endif // NET_2_0
int ConnectionTimeout {
get { return connectionTimeout; }
}
#if !NET_2_0
[DataSysDescription ("Current SQL Server database, 'Initial Catalog=X' in the connection string.")]
#endif
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
public
#if NET_2_0
override
#endif // NET_2_0
string Database {
get {
if (State == ConnectionState.Open)
@@ -207,23 +186,14 @@ namespace System.Data.SqlClient
set { dataReader = value; }
}
#if !NET_2_0
[DataSysDescription ("Current SqlServer that the connection is opened to, 'Data Source=X' in the connection string. ")]
#else
[Browsable(true)]
#endif
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
public
#if NET_2_0
override
#endif // NET_2_0
string DataSource {
get { return dataSource; }
}
#if !NET_2_0
[DataSysDescription ("Network packet size, 'Packet Size=x' in the connection string.")]
#endif
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
public int PacketSize {
get {
@@ -234,14 +204,9 @@ namespace System.Data.SqlClient
}
[Browsable (false)]
#if !NET_2_0
[DataSysDescription ("Version of the SQL Server accessed by the SqlConnection.")]
#endif
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
public
#if NET_2_0
override
#endif // NET_2_0
string ServerVersion {
get {
if (state == ConnectionState.Closed)
@@ -252,14 +217,9 @@ namespace System.Data.SqlClient
}
[Browsable (false)]
#if !NET_2_0
[DataSysDescription ("The ConnectionState indicating whether the connection is open or closed.")]
#endif
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
public
#if NET_2_0
override
#endif // NET_2_0
ConnectionState State {
get { return state; }
}
@@ -273,9 +233,6 @@ namespace System.Data.SqlClient
set { transaction = value; }
}
#if !NET_2_0
[DataSysDescription ("Workstation Id, 'Workstation ID=x' in the connection string.")]
#endif
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
public string WorkstationId {
get { return parms.Hostname; }
@@ -286,7 +243,6 @@ namespace System.Data.SqlClient
set { xmlReader = value; }
}
#if NET_2_0
public bool FireInfoMessageEventOnUserErrors {
get { return fireInfoMessageEventOnUserErrors; }
set { fireInfoMessageEventOnUserErrors = value; }
@@ -297,7 +253,6 @@ namespace System.Data.SqlClient
get { return statisticsEnabled; }
set { statisticsEnabled = value; }
}
#endif
protected internal override DbProviderFactory DbProviderFactory {
get {
@@ -309,15 +264,8 @@ namespace System.Data.SqlClient
#region Events
#if !NET_2_0
[DataSysDescription ("Event triggered when messages arrive from the DataSource.")]
#endif
public event SqlInfoMessageEventHandler InfoMessage;
#if !NET_2_0
[DataSysDescription ("Event triggered when the connection changes state.")]
public new event StateChangeEventHandler StateChange;
#endif
#endregion // Events
@@ -382,7 +330,6 @@ namespace System.Data.SqlClient
case IsolationLevel.ReadCommitted:
isolevel = "READ COMMITTED";
break;
#if NET_2_0
case IsolationLevel.Snapshot:
isolevel = "SNAPSHOT";
break;
@@ -397,16 +344,11 @@ namespace System.Data.SqlClient
"value, {0}, is not supported by " +
"the .Net Framework SqlClient " +
"Data Provider.", (int) iso));
#endif
default:
#if NET_2_0
throw new ArgumentOutOfRangeException ("IsolationLevel",
string.Format (CultureInfo.CurrentCulture,
"The IsolationLevel enumeration value, {0}, is invalid.",
(int) iso));
#else
throw new ArgumentException ("Invalid IsolationLevel parameter: must be ReadCommitted, ReadUncommitted, RepeatableRead, or Serializable.");
#endif
}
tds.Execute (String.Format ("SET TRANSACTION ISOLATION LEVEL {0};BEGIN TRANSACTION {1}", isolevel, transactionName));
@@ -416,9 +358,7 @@ namespace System.Data.SqlClient
}
public
#if NET_2_0
override
#endif // NET_2_0
void ChangeDatabase (string database)
{
if (!IsValidDatabaseName (database))
@@ -439,9 +379,7 @@ namespace System.Data.SqlClient
}
public
#if NET_2_0
override
#endif // NET_2_0
void Close ()
{
if (transaction != null && transaction.IsOpen)
@@ -516,7 +454,6 @@ namespace System.Data.SqlClient
return new SqlConnection (ConnectionString);
}
#if NET_2_0
protected override DbTransaction BeginDbTransaction (IsolationLevel isolationLevel)
{
return BeginTransaction (isolationLevel);
@@ -526,27 +463,9 @@ namespace System.Data.SqlClient
{
return CreateCommand ();
}
#else
IDbTransaction IDbConnection.BeginTransaction ()
{
return BeginTransaction ();
}
IDbTransaction IDbConnection.BeginTransaction (IsolationLevel iso)
{
return BeginTransaction (iso);
}
IDbCommand IDbConnection.CreateCommand ()
{
return CreateCommand ();
}
#endif
public
#if NET_2_0
override
#endif // NET_2_0
void Open ()
{
string serverName = string.Empty;
@@ -801,9 +720,7 @@ namespace System.Data.SqlClient
minPoolSize = DEFAULT_MINPOOLSIZE;
packetSize = DEFAULT_PACKETSIZE;
port = DEFAULT_PORT;
#if NET_2_0
async = false;
#endif
}
private void SetProperties (string name , string value)
@@ -881,7 +798,6 @@ namespace System.Data.SqlClient
else
minPoolSize = tmpMinPoolSize;
break;
#if NET_2_0
case "multipleactiveresultsets":
// FIXME: not implemented
ConvertToBoolean (name, value, false);
@@ -890,7 +806,6 @@ namespace System.Data.SqlClient
case "async" :
async = ConvertToBoolean (name, value, false);
break;
#endif
case "net" :
case "network" :
case "network library" :
@@ -930,11 +845,9 @@ namespace System.Data.SqlClient
case "workstation id" :
parms.Hostname = value;
break;
#if NET_2_0
case "user instance":
userInstance = ConvertToBoolean (name, value, false);
break;
#endif
default :
throw new ArgumentException("Keyword not supported : '" + name + "'.");
}
@@ -965,13 +878,6 @@ namespace System.Data.SqlClient
InfoMessage (this, value);
}
#if !NET_2_0
private new void OnStateChange (StateChangeEventArgs value)
{
if (StateChange != null)
StateChange (this, value);
}
#endif
private sealed class SqlMonitorSocket : UdpClient
{
@@ -1012,11 +918,7 @@ namespace System.Data.SqlClient
if (Client.Available <= 0)
return -1; // Error
#if NET_2_0
IPEndPoint endpoint = new IPEndPoint (Dns.GetHostEntry ("localhost").AddressList [0], 0);
#else
IPEndPoint endpoint = new IPEndPoint (Dns.GetHostByName ("localhost").AddressList [0], 0);
#endif
Byte [] rawrs;
rawrs = Receive (ref endpoint);
@@ -1043,7 +945,6 @@ namespace System.Data.SqlClient
}
}
#if NET_2_0
struct ColumnInfo
{
public string name;
@@ -1759,11 +1660,9 @@ namespace System.Data.SqlClient
}
}
#endif // NET_2_0
#endregion // Methods
#if NET_2_0
#region Fields Net 2
bool async;
@@ -1780,7 +1679,6 @@ namespace System.Data.SqlClient
#endregion // Properties Net 2
#endif // NET_2_0
}
}

View File

@@ -26,7 +26,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System;
using System.Text;
using System.Collections;
@@ -40,9 +39,7 @@ using System.ComponentModel;
namespace System.Data.SqlClient
{
[DefaultPropertyAttribute ("DataSource")]
#if NET_2_0
[TypeConverterAttribute ("System.Data.SqlClient.SqlConnectionStringBuilder+SqlConnectionStringBuilderConverter, " + Consts.AssemblySystem_Data)]
#endif
public sealed class SqlConnectionStringBuilder : DbConnectionStringBuilder
{
@@ -230,13 +227,8 @@ namespace System.Data.SqlClient
}
}
#if NET_2_0
[Editor ("System.Windows.Forms.Design.FileNameEditor, " + Consts.AssemblySystem_Design,
"System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)]
#else
[Editor ("Microsoft.VSDesigner.Data.Design.DBParametersEditor, " + Consts.AssemblyMicrosoft_VSDesigner,
"System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)]
#endif
[DisplayNameAttribute ("AttachDbFilename")]
[RefreshPropertiesAttribute (RefreshProperties.All)]
public string AttachDBFilename {
@@ -279,9 +271,7 @@ namespace System.Data.SqlClient
[DisplayNameAttribute ("Data Source")]
[RefreshPropertiesAttribute (RefreshProperties.All)]
#if NET_2_0
[TypeConverterAttribute ("System.Data.SqlClient.SqlConnectionStringBuilder+SqlDataSourceConverter, " + Consts.AssemblySystem_Data)]
#endif
public string DataSource {
get { return _dataSource; }
set {
@@ -312,9 +302,7 @@ namespace System.Data.SqlClient
[DisplayNameAttribute ("Failover Partner")]
[RefreshPropertiesAttribute (RefreshProperties.All)]
#if NET_2_0
[TypeConverterAttribute ("System.Data.SqlClient.SqlConnectionStringBuilder+SqlDataSourceConverter, " + Consts.AssemblySystem_Data)]
#endif
public string FailoverPartner {
get { return _failoverPartner; }
set {
@@ -325,9 +313,7 @@ namespace System.Data.SqlClient
[DisplayNameAttribute ("Initial Catalog")]
[RefreshPropertiesAttribute (RefreshProperties.All)]
#if NET_2_0
[TypeConverterAttribute ("System.Data.SqlClient.SqlConnectionStringBuilder+SqlInitialCatalogConverter, " + Consts.AssemblySystem_Data)]
#endif
public string InitialCatalog {
get { return _initialCatalog; }
set {
@@ -393,7 +379,7 @@ namespace System.Data.SqlClient
keys.Add("User Instance");
keys.Add("Context Connection");
keys.Add("Transaction Binding");
ReadOnlyCollection<string> coll = new ReadOnlyCollection<string>(keys);
var coll = new System.Collections.ObjectModel.ReadOnlyCollection<string>(keys);
return coll;
}
}
@@ -440,9 +426,7 @@ namespace System.Data.SqlClient
[DisplayNameAttribute ("Network Library")]
[RefreshPropertiesAttribute (RefreshProperties.All)]
#if NET_2_0
[TypeConverterAttribute ("System.Data.SqlClient.SqlConnectionStringBuilder+NetworkLibraryConverter, " + Consts.AssemblySystem_Data)]
#endif
public string NetworkLibrary {
get { return _networkLibrary; }
set {
@@ -544,7 +528,7 @@ namespace System.Data.SqlClient
values.Add(_userInstance);
values.Add(_contextConnection);
values.Add(_transactionBinding);
ReadOnlyCollection<object> coll = new ReadOnlyCollection<object>(values);
var coll = new System.Collections.ObjectModel.ReadOnlyCollection<object>(values);
return coll;
}
}
@@ -878,4 +862,3 @@ namespace System.Data.SqlClient
}
#endif // NET_2_0

View File

@@ -42,26 +42,11 @@ namespace System.Data.SqlClient {
[DesignerAttribute ("Microsoft.VSDesigner.Data.VS.SqlDataAdapterDesigner, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.ComponentModel.Design.IDesigner")]
[ToolboxItemAttribute ("Microsoft.VSDesigner.Data.VS.SqlDataAdapterToolboxItem, "+ Consts.AssemblyMicrosoft_VSDesigner)]
#if NET_2_0
public sealed class SqlDataAdapter : DbDataAdapter, IDbDataAdapter, IDataAdapter, ICloneable
#else
public sealed class SqlDataAdapter : DbDataAdapter, IDbDataAdapter
#endif
{
#region Fields
#if !NET_2_0
bool disposed;
#endif
#if ONLY_1_0 || ONLY_1_1
SqlCommand _selectCommand;
SqlCommand _insertCommand;
SqlCommand _updateCommand;
SqlCommand _deleteCommand;
#endif
#if NET_2_0
int updateBatchSize;
#endif
#endregion
#region Constructors
@@ -73,9 +58,7 @@ namespace System.Data.SqlClient {
public SqlDataAdapter (SqlCommand selectCommand)
{
SelectCommand = selectCommand;
#if NET_2_0
UpdateBatchSize = 1;
#endif
}
public SqlDataAdapter (string selectCommandText, SqlConnection selectConnection)
@@ -92,91 +75,47 @@ namespace System.Data.SqlClient {
#region Properties
#if !NET_2_0
[DataSysDescription ("Used during Update for deleted rows in DataSet.")]
#endif
[DefaultValue (null)]
[EditorAttribute ("Microsoft.VSDesigner.Data.Design.DBCommandEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing )]
public new SqlCommand DeleteCommand {
get {
#if NET_2_0
return (SqlCommand)base.DeleteCommand;
#else
return _deleteCommand;
#endif
}
set {
#if NET_2_0
base.DeleteCommand = value;
#else
_deleteCommand = value;
#endif
}
}
#if !NET_2_0
[DataSysDescription ("Used during Update for new rows in DataSet.")]
#endif
[DefaultValue (null)]
[EditorAttribute ("Microsoft.VSDesigner.Data.Design.DBCommandEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing )]
public new SqlCommand InsertCommand {
get {
#if NET_2_0
return (SqlCommand)base.InsertCommand;
#else
return _insertCommand;
#endif
}
set {
#if NET_2_0
base.InsertCommand = value;
#else
_insertCommand = value;
#endif
}
}
#if !NET_2_0
[DataSysDescription ("Used during Fill/FillSchema.")]
#endif
[DefaultValue (null)]
[EditorAttribute ("Microsoft.VSDesigner.Data.Design.DBCommandEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing )]
public new SqlCommand SelectCommand {
get {
#if NET_2_0
return (SqlCommand)base.SelectCommand;
#else
return _selectCommand;
#endif
}
set {
#if NET_2_0
base.SelectCommand = value;
#else
_selectCommand = value;
#endif
}
}
#if !NET_2_0
[DataSysDescription ("Used during Update for modified rows in DataSet.")]
#endif
[DefaultValue (null)]
[EditorAttribute ("Microsoft.VSDesigner.Data.Design.DBCommandEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing )]
public new SqlCommand UpdateCommand {
get {
#if NET_2_0
return (SqlCommand)base.UpdateCommand;
#else
return _updateCommand;
#endif
}
set {
#if NET_2_0
base.UpdateCommand = value;
#else
_updateCommand = value;
#endif
}
}
@@ -199,7 +138,6 @@ namespace System.Data.SqlClient {
set { DeleteCommand = (SqlCommand) value; }
}
#if NET_2_0
public override int UpdateBatchSize {
get { return updateBatchSize; }
set {
@@ -208,7 +146,6 @@ namespace System.Data.SqlClient {
updateBatchSize = value;
}
}
#endif
#endregion // Properties
@@ -225,19 +162,6 @@ namespace System.Data.SqlClient {
return new SqlRowUpdatingEventArgs (dataRow, command, statementType, tableMapping);
}
#if !NET_2_0
protected override void Dispose (bool disposing)
{
if (!disposed) {
if (disposing) {
// Release managed resources
}
// Release unmanaged resources
disposed = true;
}
base.Dispose (disposing);
}
#endif
protected override void OnRowUpdated (RowUpdatedEventArgs value)
{
@@ -251,15 +175,12 @@ namespace System.Data.SqlClient {
RowUpdating (this, (SqlRowUpdatingEventArgs) value);
}
#if NET_2_0
[MonoTODO]
object ICloneable.Clone()
{
throw new NotImplementedException ();
}
#endif
#if NET_2_0
// All the batch methods, should be implemented, if supported,
// by individual providers
@@ -298,19 +219,12 @@ namespace System.Data.SqlClient {
{
throw new NotImplementedException ();
}
#endif
#endregion // Methods
#region Events and Delegates
#if ONLY_1_1
[DataSysDescription ("Event triggered before every DataRow during Update.")]
#endif
public event SqlRowUpdatedEventHandler RowUpdated;
#if ONLY_1_1
[DataSysDescription ("Event triggered after every DataRow during Update.")]
#endif
public event SqlRowUpdatingEventHandler RowUpdating;
#endregion // Events and Delegates

File diff suppressed because it is too large Load Diff

View File

@@ -27,7 +27,6 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System;
using System.ComponentModel;
using System.Globalization;
@@ -62,4 +61,3 @@ namespace System.Data.SqlClient {
#endregion // Methods
}
}
#endif

View File

@@ -0,0 +1,18 @@
using System.Data.SqlTypes;
using Mono.Data.Tds.Protocol;
namespace System.Data.SqlClient
{
static class SqlDecimalExtensions
{
public static readonly SqlDecimal Null;
internal static SqlDecimal FromTdsBigDecimal (TdsBigDecimal x)
{
if (x == null)
return Null;
else
return new SqlDecimal (x.Precision, x.Scale, !x.IsNegative, x.Data);
}
}
}

View File

@@ -25,7 +25,6 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System;
using System.Security.Permissions;
using System.Data;
@@ -101,4 +100,3 @@ namespace System.Data.SqlClient
}
}
#endif

View File

@@ -105,13 +105,11 @@ namespace System.Data.SqlClient {
return list.GetEnumerator ();
}
#if NET_2_0
public void CopyTo (SqlError[] array, int index)
{
list.CopyTo (array, index);
}
#endif // NET_2_0
#endregion
}

Some files were not shown because too many files have changed in this diff Show More