1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
5 using System
.Collections
;
6 using System
.Collections
.Generic
;
7 using System
.Data
.Common
;
8 using System
.Data
.SqlTypes
;
9 using System
.Diagnostics
;
11 using System
.Threading
;
12 using System
.Threading
.Tasks
;
15 namespace System
.Data
.SqlClient
17 public sealed class SqlBulkCopy
: IDisposable
19 const string EXCEPTION_MESSAGE
= "System.Data.SqlClient.SqlBulkCopy is not supported on the current platform.";
21 public SqlBulkCopy(SqlConnection connection
)
22 => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE
);
24 public SqlBulkCopy(SqlConnection connection
, SqlBulkCopyOptions copyOptions
, SqlTransaction externalTransaction
)
26 => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE
);
28 public SqlBulkCopy(string connectionString
) : this(new SqlConnection(connectionString
))
29 => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE
);
31 public SqlBulkCopy(string connectionString
, SqlBulkCopyOptions copyOptions
)
32 : this(connectionString
)
33 => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE
);
35 public int BatchSize
{
36 get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE
);
37 set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE
);
40 public int BulkCopyTimeout
{
41 get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE
);
42 set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE
);
45 public bool EnableStreaming
{
46 get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE
);
47 set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE
);
50 public SqlBulkCopyColumnMappingCollection ColumnMappings
51 => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE
);
53 public string DestinationTableName
{
54 get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE
);
55 set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE
);
58 public int NotifyAfter
{
59 get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE
);
60 set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE
);
63 public event SqlRowsCopiedEventHandler SqlRowsCopied
;
65 internal SqlStatistics Statistics
66 => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE
);
68 void IDisposable
.Dispose() {}
71 => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE
);
73 public void WriteToServer(DbDataReader reader
)
74 => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE
);
76 public void WriteToServer(IDataReader reader
)
77 => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE
);
79 public void WriteToServer(DataTable table
)
80 => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE
);
82 public void WriteToServer(DataTable table
, DataRowState rowState
)
83 => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE
);
85 public void WriteToServer(DataRow
[] rows
)
86 => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE
);
88 public Task
WriteToServerAsync(DataRow
[] rows
)
89 => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE
);
91 public Task
WriteToServerAsync(DataRow
[] rows
, CancellationToken cancellationToken
)
92 => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE
);
94 public Task
WriteToServerAsync(DbDataReader reader
)
95 => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE
);
97 public Task
WriteToServerAsync(DbDataReader reader
, CancellationToken cancellationToken
)
98 => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE
);
100 public Task
WriteToServerAsync(IDataReader reader
)
101 => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE
);
103 public Task
WriteToServerAsync(IDataReader reader
, CancellationToken cancellationToken
)
104 => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE
);
106 public Task
WriteToServerAsync(DataTable table
)
107 => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE
);
109 public Task
WriteToServerAsync(DataTable table
, CancellationToken cancellationToken
)
110 => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE
);
112 public Task
WriteToServerAsync(DataTable table
, DataRowState rowState
)
113 => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE
);
115 public Task
WriteToServerAsync(DataTable table
, DataRowState rowState
, CancellationToken cancellationToken
)
116 => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE
);
118 internal void OnConnectionClosed()
119 => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE
);
122 internal static bool _setAlwaysTaskOnWrite
= false;
123 internal static bool SetAlwaysTaskOnWrite
{
124 get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE
);
125 set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE
);
130 internal sealed class _ColumnMapping
132 internal int _sourceColumnOrdinal
;
133 internal _SqlMetaData _metadata
;
134 internal _ColumnMapping(int columnId
, _SqlMetaData metadata
) {}
137 internal sealed class Row
139 internal Row(int rowCount
) {}
140 internal object[] DataFields
=> null;
141 internal object this[int index
] => null;
144 internal sealed class Result
146 internal Result(_SqlMetaDataSet metadata
) {}
147 internal int Count
=> 0;
148 internal _SqlMetaDataSet MetaData
=> null;
149 internal Row
this[int index
] => null;
150 internal void AddRow(Row row
) {}
153 internal sealed class BulkCopySimpleResultSet
155 internal BulkCopySimpleResultSet() {}
156 internal Result
this[int idx
] => null;
157 internal void SetMetaData(_SqlMetaDataSet metadata
) {}
158 internal int[] CreateIndexMap() => null;
159 internal object[] CreateRowBuffer() => null;