Imported Upstream version 4.8.0.309

Former-commit-id: 5f9c6ae75f295e057a7d2971f3a6df4656fa8850
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2016-11-10 13:04:39 +00:00
parent ee1447783b
commit 94b2861243
4912 changed files with 390737 additions and 49310 deletions

View File

@@ -0,0 +1,136 @@
//
// SqlBulkCopy.cs
//
// Author:
// Rolf Bjarne Kvinge <rolf@xamarin.com>
//
// Copyright (c) 2016 Xamarin, Inc.
//
// 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.Threading;
using System.Threading.Tasks;
namespace System.Data.SqlClient {
public sealed class SqlBulkCopy : IDisposable
{
const string EXCEPTION_MESSAGE = "System.Data.SqlClient.SqlBulkCopy is not supported on the current platform.";
public SqlBulkCopy (SqlConnection connection)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public SqlBulkCopy (string connectionString)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public SqlBulkCopy (string connectionString, SqlBulkCopyOptions copyOptions)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public SqlBulkCopy (SqlConnection connection, SqlBulkCopyOptions copyOptions, SqlTransaction externalTransaction)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public int BatchSize {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public int BulkCopyTimeout {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public SqlBulkCopyColumnMappingCollection ColumnMappings {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public string DestinationTableName {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public bool EnableStreaming {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public int NotifyAfter {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public void Close ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public void WriteToServer (DataRow [] rows)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public void WriteToServer (DataTable table)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public void WriteToServer (IDataReader reader)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public void WriteToServer (DataTable table, DataRowState rowState)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public void WriteToServer (DbDataReader reader)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public Task WriteToServerAsync (DbDataReader reader)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public Task WriteToServerAsync (DbDataReader reader, CancellationToken cancellationToken)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
private void RowsCopied (long rowsCopied)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public event SqlRowsCopiedEventHandler SqlRowsCopied;
void IDisposable.Dispose ()
{
}
}
}

View File

@@ -510,40 +510,104 @@ namespace System.Data.SqlClient {
}
}
[MonoTODO]
public new Task<SqlDataReader> ExecuteReaderAsync ()
{
throw new NotImplementedException ();
return ExecuteReaderAsync (CommandBehavior.Default, CancellationToken.None);
}
[MonoTODO]
public new Task<SqlDataReader> ExecuteReaderAsync (CancellationToken cancellationToken)
{
throw new NotImplementedException ();
return ExecuteReaderAsync (behavior, CancellationToken.None);
}
[MonoTODO]
public new Task<SqlDataReader> ExecuteReaderAsync (CommandBehavior behavior)
{
throw new NotImplementedException ();
return ExecuteReaderAsync (CommandBehavior.Default, CancellationToken.None);
}
[MonoTODO]
public new Task<SqlDataReader> ExecuteReaderAsync (CommandBehavior behavior, CancellationToken cancellationToken)
{
throw new NotImplementedException ();
TaskCompletionSource<SqlDataReader> source = new TaskCompletionSource<SqlDataReader>();
CancellationTokenRegistration registration = new CancellationTokenRegistration();
if (cancellationToken.CanBeCanceled) {
if (cancellationToken.IsCancellationRequested) {
source.SetCanceled();
return source.Task;
}
registration = cancellationToken.Register(CancelIgnoreFailure);
}
Task<SqlDataReader> returnedTask = source.Task;
try {
// TODO: RegisterForConnectionCloseNotification(ref returnedTask);
Task<SqlDataReader>.Factory.FromAsync(BeginExecuteReaderAsync, EndExecuteReader, behavior, null).ContinueWith((t) => {
registration.Dispose();
if (t.IsFaulted) {
Exception e = t.Exception.InnerException;
source.SetException(e);
}
else {
if (t.IsCanceled) {
source.SetCanceled();
}
else {
source.SetResult(t.Result);
}
}
}, TaskScheduler.Default);
}
catch (Exception e) {
source.SetException(e);
}
return returnedTask;
}
[MonoTODO]
public Task<XmlReader> ExecuteXmlReaderAsync ()
{
throw new NotImplementedException ();
return ExecuteXmlReaderAsync (CancellationToken.None);
}
[MonoTODO]
public Task<XmlReader> ExecuteXmlReaderAsync (CancellationToken cancellationToken)
{
throw new NotImplementedException ();
TaskCompletionSource<XmlReader> source = new TaskCompletionSource<XmlReader>();
CancellationTokenRegistration registration = new CancellationTokenRegistration();
if (cancellationToken.CanBeCanceled) {
if (cancellationToken.IsCancellationRequested) {
source.SetCanceled();
return source.Task;
}
registration = cancellationToken.Register(CancelIgnoreFailure);
}
Task<XmlReader> returnedTask = source.Task;
try {
// TODO: RegisterForConnectionCloseNotification(ref returnedTask);
Task<XmlReader>.Factory.FromAsync(BeginExecuteXmlReader, EndExecuteXmlReader, null).ContinueWith((t) => {
registration.Dispose();
if (t.IsFaulted) {
Exception e = t.Exception.InnerException;
source.SetException(e);
}
else {
if (t.IsCanceled) {
source.SetCanceled();
}
else {
source.SetResult(t.Result);
}
}
}, TaskScheduler.Default);
}
catch (Exception e) {
source.SetException(e);
}
return returnedTask;
}
public
@@ -846,6 +910,11 @@ namespace System.Data.SqlClient {
return BeginExecuteReader (callback, stateObject, CommandBehavior.Default);
}
IAsyncResult BeginExecuteReaderAsync(CommandBehavior behavior, AsyncCallback callback, object stateObject)
{
return BeginExecuteReader (callback, stateObject, behavior);
}
public IAsyncResult BeginExecuteReader (AsyncCallback callback, object stateObject, CommandBehavior behavior)
{
ValidateCommand ("BeginExecuteReader", true);

View File

@@ -0,0 +1,277 @@
//
// SqlCommand.cs
//
// Author:
// Rolf Bjarne Kvinge <rolf@xamarin.com>
//
// Copyright (c) 2016 Xamarin, Inc.
//
// 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.Data.Sql;
using System.Threading.Tasks;
using System.Threading;
using System.Xml;
namespace System.Data.SqlClient {
public sealed class SqlCommand : DbCommand, IDbCommand, ICloneable
{
const string EXCEPTION_MESSAGE = "System.Data.SqlClient.SqlCommand is not supported on the current platform.";
public SqlCommand()
: this (String.Empty, null, null)
{
}
public SqlCommand (string cmdText)
: this (cmdText, null, null)
{
}
public SqlCommand (string cmdText, SqlConnection connection)
: this (cmdText, connection, null)
{
}
public SqlCommand (string cmdText, SqlConnection connection, SqlTransaction transaction)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override string CommandText {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public override int CommandTimeout {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public override CommandType CommandType {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public new SqlConnection Connection {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public override bool DesignTimeVisible {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public new SqlParameterCollection Parameters {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public new SqlTransaction Transaction {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public override UpdateRowSource UpdatedRowSource {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public SqlNotificationRequest Notification {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public bool NotificationAutoEnlist {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public override void Cancel ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public SqlCommand Clone ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public new SqlParameter CreateParameter ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override int ExecuteNonQuery ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public new SqlDataReader ExecuteReader ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public new SqlDataReader ExecuteReader (CommandBehavior behavior)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public new Task<SqlDataReader> ExecuteReaderAsync ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public new Task<SqlDataReader> ExecuteReaderAsync (CancellationToken cancellationToken)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public new Task<SqlDataReader> ExecuteReaderAsync (CommandBehavior behavior)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public new Task<SqlDataReader> ExecuteReaderAsync (CommandBehavior behavior, CancellationToken cancellationToken)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public Task<XmlReader> ExecuteXmlReaderAsync ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public Task<XmlReader> ExecuteXmlReaderAsync (CancellationToken cancellationToken)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override object ExecuteScalar ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public XmlReader ExecuteXmlReader ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
object ICloneable.Clone ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
protected override void Dispose (bool disposing)
{
}
public override void Prepare ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public void ResetCommandTimeout ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
protected override DbParameter CreateDbParameter ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
protected override DbDataReader ExecuteDbDataReader (CommandBehavior behavior)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
protected override DbConnection DbConnection {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
protected override DbParameterCollection DbParameterCollection {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
protected override DbTransaction DbTransaction {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public IAsyncResult BeginExecuteNonQuery ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public IAsyncResult BeginExecuteNonQuery (AsyncCallback callback, object stateObject)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public int EndExecuteNonQuery (IAsyncResult asyncResult)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public IAsyncResult BeginExecuteReader ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public IAsyncResult BeginExecuteReader (CommandBehavior behavior)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public IAsyncResult BeginExecuteReader (AsyncCallback callback, object stateObject)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public IAsyncResult BeginExecuteReader (AsyncCallback callback, object stateObject, CommandBehavior behavior)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public SqlDataReader EndExecuteReader (IAsyncResult asyncResult)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public IAsyncResult BeginExecuteXmlReader (AsyncCallback callback, object stateObject)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public IAsyncResult BeginExecuteXmlReader ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public XmlReader EndExecuteXmlReader (IAsyncResult asyncResult)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public event StatementCompletedEventHandler StatementCompleted;
}
}

View File

@@ -0,0 +1,158 @@
//
// SqlCommandBuilder.cs
//
// Author:
// Rolf Bjarne Kvinge <rolf@xamarin.com>
//
// Copyright (c) 2016 Xamarin, Inc.
//
// 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.Data;
using System.Data.Common;
using System.Data.SqlClient;
namespace System.Data.SqlClient
{
public class SqlCommandBuilder : DbCommandBuilder
{
const string EXCEPTION_MESSAGE = "System.Data.SqlClient.SqlCommandBuilder is not supported on the current platform.";
public SqlCommandBuilder ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public SqlCommandBuilder (SqlDataAdapter adapter)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public static void DeriveParameters (SqlCommand command)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public SqlCommand GetDeleteCommand ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public SqlCommand GetInsertCommand ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public SqlCommand GetUpdateCommand ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public SqlCommand GetUpdateCommand (bool useColumnsForParameterNames)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public SqlCommand GetDeleteCommand (bool useColumnsForParameterNames)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public SqlCommand GetInsertCommand (bool useColumnsForParameterNames)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override string QuoteIdentifier (string unquotedIdentifier)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override string UnquoteIdentifier (string quotedIdentifier)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
protected override void ApplyParameterInfo (DbParameter parameter, DataRow datarow, StatementType statementType, bool whereClause)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
protected override string GetParameterName (int parameterOrdinal)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
protected override string GetParameterName (string parameterName)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
protected override string GetParameterPlaceholder (int parameterOrdinal)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
protected override void SetRowUpdatingHandler (DbDataAdapter adapter)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
protected override DataTable GetSchemaTable (DbCommand srcCommand)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
protected override DbCommand InitializeCommand (DbCommand command)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public SqlDataAdapter DataAdapter {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public override string QuotePrefix {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public override string QuoteSuffix {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public override string CatalogSeparator {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public override string SchemaSeparator {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public override CatalogLocation CatalogLocation {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
}
}

View File

@@ -928,7 +928,11 @@ namespace System.Data.SqlClient
if (Client.Available <= 0)
return -1; // Error
IPEndPoint endpoint = new IPEndPoint (Dns.GetHostEntry ("localhost").AddressList [0], 0);
IPEndPoint endpoint = CreateLocalEndpoint ();
if (endpoint == null)
return -1;
Byte [] rawrs;
rawrs = Receive (ref endpoint);
@@ -953,6 +957,16 @@ namespace System.Data.SqlClient
return SqlServerTcpPort;
}
IPEndPoint CreateLocalEndpoint ()
{
foreach (var addr in Dns.GetHostEntry ("localhost").AddressList) {
if (addr.AddressFamily == Client.AddressFamily)
return new IPEndPoint (addr, 0);
}
return null;
}
}
struct ColumnInfo

View File

@@ -0,0 +1,214 @@
//
// SqlConnection.cs
//
// Author:
// Rolf Bjarne Kvinge <rolf@xamarin.com>
//
// Copyright (c) 2016 Xamarin, Inc.
//
// 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;
namespace System.Data.SqlClient
{
public sealed class SqlConnection : DbConnection, IDbConnection, ICloneable
{
const string EXCEPTION_MESSAGE = "System.Data.SqlClient.SqlConnection is not supported on the current platform.";
public SqlConnection () : this (null)
{
}
public SqlConnection (string connectionString)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public SqlConnection (string connectionString, SqlCredential cred)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override string ConnectionString {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public SqlCredential Credentials {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public Guid ClientConnectionId {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public override int ConnectionTimeout {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public override string Database {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public override string DataSource {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public int PacketSize {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public override string ServerVersion {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public override ConnectionState State {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public string WorkstationId {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public bool FireInfoMessageEventOnUserErrors {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public bool StatisticsEnabled {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
protected override DbProviderFactory DbProviderFactory {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public event SqlInfoMessageEventHandler InfoMessage;
public new SqlTransaction BeginTransaction ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public new SqlTransaction BeginTransaction (IsolationLevel iso)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public SqlTransaction BeginTransaction (string transactionName)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public SqlTransaction BeginTransaction (IsolationLevel iso, string transactionName)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override void ChangeDatabase (string database)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override void Close ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public new SqlCommand CreateCommand ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
protected override void Dispose (bool disposing)
{
}
#if !MOBILE
public void EnlistDistributedTransaction (ITransaction transaction)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
#endif
object ICloneable.Clone ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
protected override DbTransaction BeginDbTransaction (IsolationLevel isolationLevel)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
protected override DbCommand CreateDbCommand ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override void Open ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override DataTable GetSchema ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override DataTable GetSchema (String collectionName)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override DataTable GetSchema (String collectionName, string [] restrictionValues)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public static void ChangePassword (string connectionString, string newPassword)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public static void ClearAllPools ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public static void ClearPool (SqlConnection connection)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public void ResetStatistics ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public IDictionary RetrieveStatistics ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
}
}

View File

@@ -0,0 +1,363 @@
//
// SqlDataReader.cs
//
// Author:
// Rolf Bjarne Kvinge <rolf@xamarin.com>
//
// Copyright (c) 2016 Xamarin, Inc.
//
// 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.Collections;
using System.Data.Common;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.Data;
using System.IO;
using System.Threading.Tasks;
using System.Threading;
using System.Xml;
namespace System.Data.SqlClient
{
public class SqlDataReader : DbDataReader , IDataReader, IDisposable, IDataRecord
{
const string EXCEPTION_MESSAGE = "System.Data.SqlClient.SqlDataReader is not supported on the current platform.";
SqlDataReader () {}
protected bool IsCommandBehavior (CommandBehavior condition)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override void Close ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override bool GetBoolean (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override byte GetByte (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override long GetBytes (int i, long dataIndex, byte [] buffer, int bufferIndex, int length)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override char GetChar (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override long GetChars (int i, long dataIndex, char [] buffer, int bufferIndex, int length)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override string GetDataTypeName (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override DateTime GetDateTime (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public virtual DateTimeOffset GetDateTimeOffset (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public virtual TimeSpan GetTimeSpan (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public virtual SqlChars GetSqlChars (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override Decimal GetDecimal (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override Double GetDouble (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override Type GetFieldType (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override Single GetFloat (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override Guid GetGuid (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override short GetInt16 (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override int GetInt32 (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override long GetInt64 (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override string GetName (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override int GetOrdinal (string name)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override DataTable GetSchemaTable ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public virtual SqlBinary GetSqlBinary (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public virtual SqlBoolean GetSqlBoolean (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public virtual SqlByte GetSqlByte (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public virtual SqlDateTime GetSqlDateTime (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public virtual SqlDecimal GetSqlDecimal (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public virtual SqlDouble GetSqlDouble (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public virtual SqlGuid GetSqlGuid (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public virtual SqlInt16 GetSqlInt16 (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public virtual SqlInt32 GetSqlInt32 (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public virtual SqlInt64 GetSqlInt64 (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public virtual SqlMoney GetSqlMoney (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public virtual SqlSingle GetSqlSingle (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public virtual SqlString GetSqlString (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public virtual SqlXml GetSqlXml (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public virtual object GetSqlValue (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public virtual int GetSqlValues (object [] values)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override string GetString (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override object GetValue (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override int GetValues (object [] values)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override IEnumerator GetEnumerator ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override bool IsDBNull (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override bool NextResult ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override bool Read ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override Type GetProviderSpecificFieldType (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override object GetProviderSpecificValue (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override int GetProviderSpecificValues (object [] values)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public virtual SqlBytes GetSqlBytes (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override T GetFieldValue<T> (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public virtual XmlReader GetXmlReader (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override Task<T> GetFieldValueAsync<T> (int i, CancellationToken cancellationToken)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override Stream GetStream (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override TextReader GetTextReader (int i)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override Task<bool> IsDBNullAsync (int i, CancellationToken cancellationToken)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override int Depth {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public override int FieldCount {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public override bool IsClosed {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public override object this [int i] {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public override object this [string name] {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public override int RecordsAffected {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public override bool HasRows {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public override int VisibleFieldCount {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
protected SqlConnection Connection {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
}
}

View File

@@ -0,0 +1,102 @@
//
// SqlException.cs
//
// Author:
// Rolf Bjarne Kvinge <rolf@xamarin.com>
//
// Copyright (c) 2016 Xamarin, Inc.
//
// 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.Data.Common;
using System.Data.SqlClient;
using System.Runtime.Serialization;
namespace System.Data.SqlClient
{
public class SqlException : DbException
{
const string EXCEPTION_MESSAGE = "System.Data.SqlClient.SqlException is not supported on the current platform.";
internal bool _doNotReconnect;
static internal SqlException CreateException(SqlErrorCollection errorCollection, string serverVersion)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
static internal SqlException CreateException(SqlErrorCollection errorCollection, string serverVersion, SqlInternalConnectionTds internalConnection, Exception innerException = null)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
static internal SqlException CreateException(SqlErrorCollection errorCollection, string serverVersion, Guid conId, Exception innerException = null)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
SqlException () {}
public override void GetObjectData (SerializationInfo si, StreamingContext context)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public byte Class {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public Guid ClientConnectionId {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public SqlErrorCollection Errors {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public int LineNumber {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public override string Message {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public int Number {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public string Procedure {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public string Server {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public override string Source {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public byte State {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
}
}

View File

@@ -0,0 +1,198 @@
//
// SqlParameter.cs
//
// Author:
// Rolf Bjarne Kvinge <rolf@xamarin.com>
//
// Copyright (c) 2016 Xamarin, Inc.
//
// 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.Data;
using System.Data.Common;
using System.Data.SqlTypes;
namespace System.Data.SqlClient
{
public class SqlParameter : DbParameter , IDbDataParameter, IDataParameter, ICloneable
{
const string EXCEPTION_MESSAGE = "System.Data.SqlClient.SqlParameter is not supported on the current platform.";
public SqlParameter ()
: this (String.Empty, SqlDbType.NVarChar, 0, ParameterDirection.Input, false, 0, 0, String.Empty, DataRowVersion.Current, null)
{
}
public SqlParameter (string parameterName, object value)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public SqlParameter (string parameterName, SqlDbType dbType)
: this (parameterName, dbType, 0, ParameterDirection.Input, false, 0, 0, null, DataRowVersion.Current, null)
{
}
public SqlParameter (string parameterName, SqlDbType dbType, int size)
: this (parameterName, dbType, size, ParameterDirection.Input, false, 0, 0, null, DataRowVersion.Current, null)
{
}
public SqlParameter (string parameterName, SqlDbType dbType, int size, string sourceColumn)
: this (parameterName, dbType, size, ParameterDirection.Input, false, 0, 0, sourceColumn, DataRowVersion.Current, null)
{
}
public SqlParameter (string parameterName, SqlDbType dbType, int size, ParameterDirection direction, bool isNullable, byte precision, byte scale, string sourceColumn, DataRowVersion sourceVersion, object value)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public SqlParameter (string parameterName, SqlDbType dbType, int size, ParameterDirection direction, byte precision, byte scale, string sourceColumn, DataRowVersion sourceVersion, bool sourceColumnNullMapping, Object value, string xmlSchemaCollectionDatabase, string xmlSchemaCollectionOwningSchema, string xmlSchemaCollectionName)
: this (parameterName, dbType, size, direction, false, precision, scale, sourceColumn, sourceVersion, value)
{
}
public override string ToString ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override void ResetDbType ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public void ResetSqlDbType ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override DbType DbType {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public override ParameterDirection Direction {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public override bool IsNullable {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public int Offset {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public override string ParameterName {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public byte Precision {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public byte Scale {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public override int Size {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public override string SourceColumn {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public override DataRowVersion SourceVersion {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public SqlDbType SqlDbType {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public override object Value {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public SqlCompareOptions CompareInfo {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public int LocaleId {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public object SqlValue {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public override bool SourceColumnNullMapping {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public string XmlSchemaCollectionDatabase {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public string XmlSchemaCollectionName {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public string XmlSchemaCollectionOwningSchema {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public string UdtTypeName {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public string TypeName {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
object ICloneable.Clone ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
}
}

View File

@@ -0,0 +1,216 @@
//
// SqlParameterCollection.cs
//
// Author:
// Rolf Bjarne Kvinge <rolf@xamarin.com>
//
// Copyright (c) 2016 Xamarin, Inc.
//
// 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.Collections;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
namespace System.Data.SqlClient
{
public class SqlParameterCollection : DbParameterCollection , IDataParameterCollection, IList, ICollection, IEnumerable
{
const string EXCEPTION_MESSAGE = "System.Data.SqlClient.SqlParameterCollection is not supported on the current platform.";
SqlParameterCollection () {}
protected override DbParameter GetParameter (int index)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
protected override DbParameter GetParameter (string parameterName)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
protected override void SetParameter (int index, DbParameter value)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
protected override void SetParameter (string parameterName, DbParameter value)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override int Add (object value)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public SqlParameter Add (SqlParameter value)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public SqlParameter Add (string parameterName, object value)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public SqlParameter AddWithValue (string parameterName, object value)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public SqlParameter Add (string parameterName, SqlDbType sqlDbType)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public SqlParameter Add (string parameterName, SqlDbType sqlDbType, int size)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public SqlParameter Add (string parameterName, SqlDbType sqlDbType, int size, string sourceColumn)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override void Clear ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override bool Contains (object value)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override bool Contains (string value)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public bool Contains (SqlParameter value)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override void CopyTo (Array array, int index)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override IEnumerator GetEnumerator ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override int IndexOf (object value)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override int IndexOf (string parameterName)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public int IndexOf (SqlParameter value)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override void Insert (int index, object value)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public void Insert (int index, SqlParameter value)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override void Remove (object value)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public void Remove (SqlParameter value)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override void RemoveAt (int index)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override void RemoveAt (string parameterName)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override void AddRange (Array values)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public void AddRange (SqlParameter [] values)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public void CopyTo (SqlParameter [] array, int index)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override int Count {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public override bool IsFixedSize {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public override bool IsReadOnly {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public override bool IsSynchronized {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public override object SyncRoot {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public SqlParameter this [int index] {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public SqlParameter this [string parameterName] {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
}
}

View File

@@ -0,0 +1,77 @@
//
// SqlTransaction.cs
//
// Author:
// Rolf Bjarne Kvinge <rolf@xamarin.com>
//
// Copyright (c) 2016 Xamarin, Inc.
//
// 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.Data;
using System.Data.Common;
using System.Data.SqlClient;
namespace System.Data.SqlClient
{
public class SqlTransaction : DbTransaction , IDbTransaction, IDisposable
{
const string EXCEPTION_MESSAGE = "System.Data.SqlClient.SqlTransaction is not supported on the current platform.";
SqlTransaction () {}
public override void Commit ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
protected override void Dispose (bool disposing)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public override void Rollback ()
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public void Rollback (string transactionName)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public void Save (string savePointName)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public SqlConnection Connection {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
public override IsolationLevel IsolationLevel {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
protected override DbConnection DbConnection {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
}
}