Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,65 @@
//
// System.Data.SqlClient.NetworkLibraryConverter.cs
//
// Author:
// Nagappan A (anagappan@novell.com)
//
//
// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// 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;
namespace System.Data.SqlClient {
internal sealed class NetworkLibraryConverter : ExpandableObjectConverter
{
#region Constructors
[MonoTODO]
public NetworkLibraryConverter ()
{
throw new NotImplementedException ();
}
#endregion // Constructors
#region Methods
[MonoTODO]
public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
{
throw new NotImplementedException ();
}
[MonoTODO]
public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType)
{
throw new NotImplementedException ();
}
#endregion // Methods
}
}
#endif

View File

@@ -0,0 +1,38 @@
//
// System.Data.SqlClient.OnChangeEventHandler.cs
//
// Author:
// Umadevi S (sumadevi@novell.com)
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// 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;
namespace System.Data.SqlClient {
public delegate void OnChangeEventHandler(object sender, SqlNotificationEventArgs e);
}
#endif

View File

@@ -0,0 +1,50 @@
//
// System.Data.SqlClient.SQLDebugging.cs
//
// Authors:
// Umadevi S (sumadevi@novell.com)
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Data;
using System.Runtime.InteropServices;
namespace System.Data.SqlClient
{
[ComVisible (true)]
[GuidAttribute ("afef65ad-4577-447a-a148-83acadd3d4b9")]
[ClassInterface (ClassInterfaceType.None)]
public
#if NET_2_0
sealed
#endif
class SQLDebugging
{
[MonoTODO]
public SQLDebugging ()
{
throw new NotImplementedException ();
}
}
}

View File

@@ -0,0 +1,40 @@
//
// System.Data.SqlClient.SortOrder.cs
//
// Author:
// Jonathan Pobst (monkey@jpobst.com)
//
//
// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
namespace System.Data.SqlClient
{
public enum SortOrder
{
Ascending = 0,
Descending = 1,
Unspecified = -1
}
}

View File

@@ -0,0 +1,139 @@
//
// System.Data.SqlClient.SqlAsyncResult.cs
//
// Author:
// T Sureshkumar <tsureshkumar@novell.com>
// Ankit Jain <radical@corewars.org>
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// 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.Threading;
namespace System.Data.SqlClient
{
internal class SqlAsyncResult : IAsyncResult
{
private SqlAsyncState _sqlState;
private WaitHandle _waitHandle;
private bool _completed = false;
private bool _completedSyncly = false;
private bool _ended = false;
private AsyncCallback _userCallback = null;
private object _retValue;
private string _endMethod;
private IAsyncResult _internal;
public SqlAsyncResult (AsyncCallback userCallback, SqlAsyncState sqlState)
{
_sqlState = sqlState;
_userCallback = userCallback;
_waitHandle = new ManualResetEvent (false);
}
public SqlAsyncResult (AsyncCallback userCallback, object state)
{
_sqlState = new SqlAsyncState (state);
_userCallback = userCallback;
_waitHandle = new ManualResetEvent (false);
}
public object AsyncState
{
get { return _sqlState.UserState; }
}
internal SqlAsyncState SqlAsyncState
{
get { return _sqlState; }
}
public WaitHandle AsyncWaitHandle
{
get { return _waitHandle; }
}
public bool IsCompleted
{
get { return _completed; }
}
public bool CompletedSynchronously
{
get { return _completedSyncly; }
}
internal object ReturnValue
{
get { return _retValue; }
set { _retValue = value; }
}
public string EndMethod
{
get { return _endMethod; }
set { _endMethod = value; }
}
public bool Ended
{
get { return _ended; }
set { _ended = value; }
}
internal IAsyncResult InternalResult
{
get { return _internal; }
set { _internal = value; }
}
public AsyncCallback BubbleCallback
{
get { return new AsyncCallback (Bubbleback); }
}
internal void MarkComplete ()
{
_completed = true;
((ManualResetEvent)_waitHandle).Set ();
if (_userCallback != null)
_userCallback (this);
}
public void Bubbleback (IAsyncResult ar)
{
this.MarkComplete ();
}
}
}
#endif // NET_2_0

View File

@@ -0,0 +1,56 @@
//
// System.Data.SqlClient.SqlAsyncState.cs
//
// Author:
// T Sureshkumar <tsureshkumar@novell.com>
// Ankit Jain <radical@corewars.org>
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// 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.Net.Sockets;
namespace System.Data.SqlClient
{
internal class SqlAsyncState
{
object _userState;
public SqlAsyncState (object userState)
{
_userState = userState;
}
public object UserState
{
get {return _userState;}
set {_userState = value;}
}
}
}
#endif // NET_2_0

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,138 @@
//
// System.Data.SqlClient.SqlBulkCopyColumnMapping.cs
//
// Author:
// Umadevi S <sumadevi@novell.com>
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// 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
namespace System.Data.SqlClient
{
/// <summary>
/// Class that defines the mapping between a column in the destination table and an
/// column in the datasource of SqlBulkCopy's instance
/// </summary>
public sealed class SqlBulkCopyColumnMapping {
#region Fields
int sourceOrdinal = -1;
int destinationOrdinal = -1;
string sourceColumn = null;
string destinationColumn = null;
#endregion //Fields
#region Constructors
public SqlBulkCopyColumnMapping() {
}
public SqlBulkCopyColumnMapping(int sourceColumnOrdinal, int destinationOrdinal){
SourceOrdinal = sourceColumnOrdinal;
DestinationOrdinal = destinationOrdinal;
}
public SqlBulkCopyColumnMapping(int sourceColumnOrdinal, string destinationColumn){
SourceOrdinal = sourceColumnOrdinal;
DestinationColumn = destinationColumn;
}
public SqlBulkCopyColumnMapping(string sourceColumn, int destinationOrdinal){
SourceColumn = sourceColumn;
DestinationOrdinal = destinationOrdinal;
}
public SqlBulkCopyColumnMapping(string sourceColumn, string destinationColumn){
SourceColumn = sourceColumn;
DestinationColumn = destinationColumn;
}
# endregion //Constructors
# region Properties
public String DestinationColumn {
get {
if (this.destinationColumn != null)
return destinationColumn;
else
return string.Empty; //ms:doesnot return null.
}
set {
// ms: whenever the name is set the ordinal is reset to -1
this.destinationOrdinal = -1;
this.destinationColumn = value;
}
}
public String SourceColumn {
get {
if (this.sourceColumn != null)
return sourceColumn;
else
return string.Empty;//ms doesnot return null
}
set {
// ms: whenever the name is set the ordinal is reset to -1
this.sourceOrdinal = -1;
this.sourceColumn = value;
}
}
public int DestinationOrdinal {
get {
return this.destinationOrdinal;
}
set {
// ms: whenever the ordinal is set, the name is null
if (value < 0)
throw new IndexOutOfRangeException ();
this.destinationColumn = null;
this.destinationOrdinal = value;
}
}
public int SourceOrdinal {
get {
return this.sourceOrdinal;
}
set {
// ms: whenever the ordinal is set, the name is null
if (value < 0)
throw new IndexOutOfRangeException ();
this.sourceColumn = null;
this.sourceOrdinal = value;
}
}
#endregion //Properties
}
}
#endif

View File

@@ -0,0 +1,150 @@
//
// System.Data.SqlClient.SqlBulkCopyColumnMappingCollection.cs
//
// Author:
// Nagappan A <anagappan@novell.com>
//
//
// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// 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;
using System.Data.Common;
using System.Collections;
namespace System.Data.SqlClient
{
public sealed class SqlBulkCopyColumnMappingCollection : CollectionBase
{
#region Constructors
internal SqlBulkCopyColumnMappingCollection ()
{
// Do nothing - Created the constructor as the class status page
// was reporting extra constructor which gets generated by default
}
#endregion // Constructors
public SqlBulkCopyColumnMapping this [int index] {
get {
if (index < 0 || index > base.Count)
throw new ArgumentOutOfRangeException ("Index is out of range");
return (SqlBulkCopyColumnMapping) base.List [index];
}
}
#region Methods
public SqlBulkCopyColumnMapping Add (SqlBulkCopyColumnMapping bulkCopyColumnMapping)
{
if (bulkCopyColumnMapping == null)
throw new ArgumentNullException ("bulkCopyColumnMapping");
List.Add (bulkCopyColumnMapping);
return bulkCopyColumnMapping;
}
public SqlBulkCopyColumnMapping Add (int sourceColumnIndex, int destinationColumnIndex)
{
SqlBulkCopyColumnMapping columnMapping = new SqlBulkCopyColumnMapping (sourceColumnIndex,
destinationColumnIndex);
return Add (columnMapping);
}
public SqlBulkCopyColumnMapping Add (int sourceColumnIndex, string destinationColumn)
{
SqlBulkCopyColumnMapping columnMapping = new SqlBulkCopyColumnMapping (sourceColumnIndex,
destinationColumn);
return Add (columnMapping);
}
public SqlBulkCopyColumnMapping Add (string sourceColumn, int destinationColumnIndex)
{
SqlBulkCopyColumnMapping columnMapping = new SqlBulkCopyColumnMapping (sourceColumn,
destinationColumnIndex);
return Add (columnMapping);
}
public SqlBulkCopyColumnMapping Add (string sourceColumn, string destinationColumn)
{
SqlBulkCopyColumnMapping columnMapping = new SqlBulkCopyColumnMapping (sourceColumn,
destinationColumn);
return Add (columnMapping);
}
public new void Clear ()
{
List.Clear ();
}
public bool Contains (SqlBulkCopyColumnMapping value)
{
return List.Contains (value);
}
public int IndexOf (SqlBulkCopyColumnMapping value)
{
return List.IndexOf (value);
}
public void CopyTo (SqlBulkCopyColumnMapping [] array, int index)
{
if (index < 0 || index > base.Count)
throw new ArgumentOutOfRangeException ("Index is out of range");
if (array == null)
throw new ArgumentNullException ("array");
int len = base.Count;
if (len - index > array.Length)
len = array.Length;
for (int i = index, j = 0; i < base.Count; i++, j++)
array [j] = (SqlBulkCopyColumnMapping) List [i];
}
public void Insert (int index, SqlBulkCopyColumnMapping value)
{
if (index < 0 || index > base.Count)
throw new ArgumentOutOfRangeException ("Index is out of range");
List.Insert (index, value);
}
public void Remove (SqlBulkCopyColumnMapping value)
{
List.Remove (value);
}
public new void RemoveAt (int index)
{
if (index < 0 || index > base.Count)
throw new ArgumentOutOfRangeException ("Index is out of range");
base.RemoveAt (index);
}
#endregion
}
}
#endif

View File

@@ -0,0 +1,79 @@
//
// System.Data.SqlClient.SqlBulkCopyOptions.cs
//
// Author:
// Umadevi S <sumadevi@novell.com>
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// 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
namespace System.Data.SqlClient
{
/// <summary>
/// Bitwise flag that specifies one or more options to use with an instance
/// of the SqlBulkCopy
/// </summary>
[Flags]
public enum SqlBulkCopyOptions {
/// <summary>
/// Use the default values for all options.
/// </summary>
Default = 0,
/// <summary>
/// Preserve source identity values. When not specified,
/// identity values are assigned by the destination.
/// </summary>
KeepIdentity = 1,
/// <summary>
/// Check constraints while data is being inserted.
/// By default, constraints are not checked.
/// </summary>
CheckConstraints = 2,
/// <summary>
/// Obtain a bulk update lock for the duration of the bulk copy operation.
/// When not specified, row locks are used.
/// </summary>
TableLock = 4,
/// <summary>
/// Preserve null values in the destination table regardless of the settings for default values.
/// When not specified, null values are replaced by default values where applicable.
/// </summary>
KeepNulls = 8,
/// <summary>
/// When specified, cause the server to fire the insert triggers
/// for the rows being inserted into the database.
/// </summary>
FireTriggers = 16,
/// <summary>
/// When specified, each batch of the bulk-copy operation will occur within a transaction.
/// If you indicate this option and also provide a SqlTransaction object to the constructor,
/// an ArgumentException occurs.
/// </summary>
UseInternalTransaction = 32
}
}
#endif

View File

@@ -0,0 +1,106 @@
//
// System.Data.SqlClient.SqlClientFactory.cs
//
// Author:
// Sureshkumar T (tsureshkumar@novell.com)
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Data;
using System.Data.Common;
using System.Data.Sql;
using System.Security;
using System.Security.Permissions;
namespace System.Data.SqlClient
{
public sealed class SqlClientFactory : DbProviderFactory
{
#region Fields
public static readonly SqlClientFactory Instance = new SqlClientFactory ();
#endregion //Fields
#region Constructors
private SqlClientFactory ()
{
}
#endregion //Constructors
#region Properties
public override bool CanCreateDataSourceEnumerator {
get { return true; }
}
#endregion //Properties
#region public overrides
public override DbCommand CreateCommand ()
{
return new SqlCommand ();
}
public override DbCommandBuilder CreateCommandBuilder ()
{
return new SqlCommandBuilder ();
}
public override DbConnection CreateConnection ()
{
return new SqlConnection ();
}
public override DbConnectionStringBuilder CreateConnectionStringBuilder ()
{
return new SqlConnectionStringBuilder ();
}
public override DbDataAdapter CreateDataAdapter ()
{
return new SqlDataAdapter ();
}
public override DbDataSourceEnumerator CreateDataSourceEnumerator ()
{
return SqlDataSourceEnumerator.Instance;
}
public override DbParameter CreateParameter ()
{
return new SqlParameter ();
}
public override CodeAccessPermission CreatePermission (PermissionState state)
{
return new SqlClientPermission(state);
}
#endregion // public overrides
}
}

View File

@@ -0,0 +1,57 @@
//
// System.Data.SqlClient.SqlClientMetaDataCollectionNames.cs
//
// Author:
// Umadevi S <sumadevi@novell.com>
//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// 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
namespace System.Data.SqlClient
{
/// <summary>
/// Collection names
/// </summary>
public static class SqlClientMetaDataCollectionNames {
public static readonly string Columns = "Columns";
public static readonly string Databases = "Databases";
public static readonly string ForeignKeys = "ForeignKeys";
public static readonly string IndexColumns = "IndexColumns";
public static readonly string Indexes = "Indexes";
public static readonly string Parameters = "Parameters";
public static readonly string ProcedureColumns = "ProcedureColumns";
public static readonly string Procedures = "Procedures";
public static readonly string Tables = "Tables";
public static readonly string UserDefinedTypes = "UserDefinedTypes";
public static readonly string Users = "Users";
public static readonly string ViewColumns = "ViewColumns";
public static readonly string Views = "Views";
}
}
#endif

View File

@@ -0,0 +1,94 @@
//
// System.Data.SqlClient.SqlClientPermission.cs
//
// Authors:
// Rodrigo Moya (rodrigo@ximian.com)
// Daniel Morgan (danmorg@sc.rr.com)
// Tim Coleman (tim@timcoleman.com)
// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) Ximian, Inc 2002
// Copyright (C) Tim Coleman, 2002
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Collections;
using System.Data.Common;
using System.Security;
using System.Security.Permissions;
namespace System.Data.SqlClient {
[Serializable]
public sealed class SqlClientPermission : DBDataPermission {
#region Fields
#endregion // Fields
#region Constructors
[Obsolete ("Use SqlClientPermission(PermissionState.None)", true)]
public SqlClientPermission ()
: this (PermissionState.None)
{
}
public SqlClientPermission (PermissionState state)
: base (state)
{
}
[Obsolete ("Use SqlClientPermission(PermissionState.None)", true)]
public SqlClientPermission (PermissionState state, bool allowBlankPassword)
: base (state)
{
AllowBlankPassword = allowBlankPassword;
}
// required for Copy method
internal SqlClientPermission (DBDataPermission permission)
: base (permission)
{
}
// easier (and common) permission creation from attribute class
internal SqlClientPermission (DBDataPermissionAttribute attribute)
: base (attribute)
{
}
#endregion // Constructors
#region Methods
public override IPermission Copy ()
{
return new SqlClientPermission (this);
}
public override void Add (string connectionString, string restrictions, KeyRestrictionBehavior behavior)
{
base.Add (connectionString, restrictions, behavior);
}
#endregion // Methods
}
}

View File

@@ -0,0 +1,65 @@
//
// System.Data.SqlClient.SqlClientPermissionAttribute.cs
//
// Authors:
// Rodrigo Moya (rodrigo@ximian.com)
// Daniel Morgan (danmorg@sc.rr.com)
// Tim Coleman (tim@timcoleman.com)
// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) Ximian, Inc 2002
// Copyright (C) Tim Coleman, 2002
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Data.Common;
using System.Security;
using System.Security.Permissions;
namespace System.Data.SqlClient {
[AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
AttributeTargets.Struct | AttributeTargets.Constructor |
AttributeTargets.Method, AllowMultiple=true,
Inherited=false)]
[Serializable]
public sealed class SqlClientPermissionAttribute : DBDataPermissionAttribute {
#region Constructors
public SqlClientPermissionAttribute (SecurityAction action)
: base (action)
{
}
#endregion // Constructors
#region Methods
public override IPermission CreatePermission ()
{
return new SqlClientPermission (this);
}
#endregion // Methods
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,318 @@
//
// System.Data.SqlClient.SqlDataAdapter.cs
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
// Daniel Morgan (danmorg@sc.rr.com)
// Tim Coleman (tim@timcoleman.com)
// Veerapuram Varadhan (vvaradhan@novell.com)
//
// (C) Ximian, Inc 2002
// Copyright (C) 2002 Tim Coleman
//
// Copyright (C) 2004, 2009 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.ComponentModel;
using System.Data;
using System.Data.Common;
namespace System.Data.SqlClient {
[DefaultEvent ("RowUpdated")]
[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
public SqlDataAdapter () : this ((SqlCommand) null)
{
}
public SqlDataAdapter (SqlCommand selectCommand)
{
SelectCommand = selectCommand;
#if NET_2_0
UpdateBatchSize = 1;
#endif
}
public SqlDataAdapter (string selectCommandText, SqlConnection selectConnection)
: this (new SqlCommand (selectCommandText, selectConnection))
{
}
public SqlDataAdapter (string selectCommandText, string selectConnectionString)
: this (selectCommandText, new SqlConnection (selectConnectionString))
{
}
#endregion
#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
}
}
IDbCommand IDbDataAdapter.SelectCommand {
get { return SelectCommand; }
set { SelectCommand = (SqlCommand) value; }
}
IDbCommand IDbDataAdapter.InsertCommand {
get { return InsertCommand; }
set { InsertCommand = (SqlCommand) value; }
}
IDbCommand IDbDataAdapter.UpdateCommand {
get { return UpdateCommand; }
set { UpdateCommand = (SqlCommand) value; }
}
IDbCommand IDbDataAdapter.DeleteCommand {
get { return DeleteCommand; }
set { DeleteCommand = (SqlCommand) value; }
}
#if NET_2_0
public override int UpdateBatchSize {
get { return updateBatchSize; }
set {
if (value < 0)
throw new ArgumentOutOfRangeException ("UpdateBatchSize");
updateBatchSize = value;
}
}
#endif
#endregion // Properties
#region Methods
protected override RowUpdatedEventArgs CreateRowUpdatedEvent (DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping)
{
return new SqlRowUpdatedEventArgs (dataRow, command, statementType, tableMapping);
}
protected override RowUpdatingEventArgs CreateRowUpdatingEvent (DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping)
{
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)
{
if (RowUpdated != null)
RowUpdated (this, (SqlRowUpdatedEventArgs) value);
}
protected override void OnRowUpdating (RowUpdatingEventArgs value)
{
if (RowUpdating != null)
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
[MonoTODO]
protected override int AddToBatch (IDbCommand command)
{
throw new NotImplementedException ();
}
[MonoTODO]
protected override void ClearBatch ()
{
throw new NotImplementedException ();
}
[MonoTODO]
protected override int ExecuteBatch ()
{
throw new NotImplementedException ();
}
[MonoTODO]
protected override IDataParameter GetBatchedParameter (int commandIdentifier, int parameterIndex)
{
throw new NotImplementedException ();
}
[MonoTODO]
protected override void InitializeBatching ()
{
throw new NotImplementedException ();
}
[MonoTODO]
protected override void TerminateBatching ()
{
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
}
}

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