Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs')
-rw-r--r--mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs127
1 files changed, 75 insertions, 52 deletions
diff --git a/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs b/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs
index 87b5f355a11..e021bc32356 100644
--- a/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs
+++ b/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs
@@ -69,6 +69,20 @@ namespace System.Data.Common {
#region Properties
#if NET_2_0
+ [MonoTODO]
+ protected virtual IDbConnection BaseConnection {
+ get { throw new NotImplementedException (); }
+ set { throw new NotImplementedException (); }
+ }
+
+ public IDbConnection Connection {
+ get { return BaseConnection; }
+ set { BaseConnection = value; }
+ }
+#endif
+
+
+#if NET_2_0
protected internal CommandBehavior FillCommandBehavior {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
@@ -78,6 +92,17 @@ namespace System.Data.Common {
#if NET_2_0
[MonoTODO]
+ protected virtual IDbCommand this [[Optional] StatementType statementType] {
+ get { throw new NotImplementedException (); }
+ set { throw new NotImplementedException (); }
+ }
+
+ [MonoTODO]
+ protected virtual DbProviderFactory ProviderFactory {
+ get { throw new NotImplementedException (); }
+ }
+
+ [MonoTODO]
IDbCommand IDbDataAdapter.SelectCommand {
get { return ((IDbDataAdapter) this).SelectCommand; }
set { throw new NotImplementedException(); }
@@ -102,39 +127,36 @@ namespace System.Data.Common {
}
[MonoTODO]
- [Browsable (false)]
- [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
public DbCommand SelectCommand {
get { return (DbCommand) ((IDbDataAdapter) this).SelectCommand; }
set { throw new NotImplementedException(); }
}
[MonoTODO]
- [Browsable (false)]
- [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
public DbCommand DeleteCommand {
get { return (DbCommand) ((IDbDataAdapter) this).DeleteCommand; }
set { throw new NotImplementedException(); }
}
[MonoTODO]
- [Browsable (false)]
- [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
public DbCommand InsertCommand {
get { return (DbCommand) ((IDbDataAdapter) this).InsertCommand; }
set { throw new NotImplementedException(); }
}
[MonoTODO]
- [Browsable (false)]
- [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
public DbCommand UpdateCommand {
get { return (DbCommand) ((IDbDataAdapter) this).UpdateCommand; }
set { throw new NotImplementedException(); }
}
[MonoTODO]
- [DefaultValue (1)]
+ public IDbTransaction Transaction {
+ get { throw new NotImplementedException (); }
+ set { throw new NotImplementedException (); }
+ }
+
+ [MonoTODO]
public int UpdateBatchSize {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
@@ -173,40 +195,16 @@ namespace System.Data.Common {
#region Methods
#if NET_2_0
- protected virtual RowUpdatedEventArgs CreateRowUpdatedEvent (DataRow dataRow, IDbCommand command,
- StatementType statementType,
- DataTableMapping tableMapping)
- {
- return new RowUpdatedEventArgs (dataRow, command, statementType, tableMapping);
- }
-
- protected virtual RowUpdatingEventArgs CreateRowUpdatingEvent (DataRow dataRow, IDbCommand command,
- StatementType statementType,
- DataTableMapping tableMapping)
- {
- return new RowUpdatingEventArgs (dataRow, command, statementType, tableMapping);
- }
-
[MonoTODO]
- protected virtual void OnRowUpdated (RowUpdatedEventArgs value)
+ public virtual void BeginInit ()
{
+ throw new NotImplementedException ();
}
+#endif
- [MonoTODO]
- protected virtual void OnRowUpdating (RowUpdatingEventArgs value)
- {
- }
-#else
- protected abstract RowUpdatedEventArgs CreateRowUpdatedEvent (DataRow dataRow, IDbCommand command,
- StatementType statementType,
- DataTableMapping tableMapping);
- protected abstract RowUpdatingEventArgs CreateRowUpdatingEvent (DataRow dataRow, IDbCommand command,
- StatementType statementType,
- DataTableMapping tableMapping);
+ protected abstract RowUpdatedEventArgs CreateRowUpdatedEvent (DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping);
+ protected abstract RowUpdatingEventArgs CreateRowUpdatingEvent (DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping);
- protected abstract void OnRowUpdated (RowUpdatedEventArgs value);
- protected abstract void OnRowUpdating (RowUpdatingEventArgs value);
-#endif
private FillErrorEventArgs CreateFillErrorEvent (DataTable dataTable, object[] values, Exception e)
{
FillErrorEventArgs args = new FillErrorEventArgs (dataTable, values);
@@ -238,6 +236,14 @@ namespace System.Data.Common {
}
}
+#if NET_2_0
+ [MonoTODO]
+ public virtual void EndInit ()
+ {
+ throw new NotImplementedException ();
+ }
+#endif
+
public override int Fill (DataSet dataSet)
{
return Fill (dataSet, 0, 0, DefaultSourceTableName, ((IDbDataAdapter) this).SelectCommand, CommandBehavior.Default);
@@ -259,7 +265,7 @@ namespace System.Data.Common {
#if NET_2_0
protected override int Fill (DataTable dataTable, IDataReader dataReader)
#else
- protected virtual int Fill (DataTable dataTable, IDataReader dataReader)
+ protected virtual int Fill (DataTable dataTable, IDataReader dataReader)
#endif
{
if (dataReader.FieldCount == 0) {
@@ -408,12 +414,13 @@ namespace System.Data.Common {
dataReader.Read ();
}
- dataTable.BeginLoadData ();
while (dataReader.Read () && (maxRecords == 0 || (counter - counterStart) < maxRecords)) {
try {
+ dataTable.BeginLoadData ();
dataTable.LoadDataRow (dataReader, sortedMapping, length, AcceptChangesDuringFill);
+ dataTable.EndLoadData ();
counter++;
- }
+ }
catch (Exception e) {
object[] readerArray = new object[dataReader.FieldCount];
object[] tableArray = new object[mapping.Length];
@@ -427,22 +434,20 @@ namespace System.Data.Common {
}
FillErrorEventArgs args = CreateFillErrorEvent (dataTable, tableArray, e);
OnFillError (args);
-
- // if args.Continue is not set to true or if a handler is not set, rethrow the error..
- if(!args.Continue)
- throw e;
+ if(!args.Continue) {
+ return false;
+ }
}
}
- dataTable.EndLoadData ();
return true;
}
#if NET_2_0
- /// <summary>
- /// Fills the given datatable using values from reader. if a value
- /// for a column is null, that will be filled with default value.
- /// </summary>
- /// <returns>No. of rows affected </returns>
+ /// <summary>
+ /// Fills the given datatable using values from reader. if a value
+ /// for a column is null, that will be filled with default value.
+ /// </summary>
+ /// <returns>No. of rows affected </returns>
internal static int FillFromReader (DataTable table,
IDataReader reader,
int start,
@@ -580,6 +585,20 @@ namespace System.Data.Common {
return (DataTable[]) output.ToArray (typeof (DataTable));
}
+#if NET_2_0
+ [MonoTODO]
+ public DataSet GetDataSet ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public DataTable GetDataTable ()
+ {
+ throw new NotImplementedException ();
+ }
+#endif
+
private string SetupSchema (SchemaType schemaType, string sourceTableName)
{
DataTableMapping tableMapping = null;
@@ -743,7 +762,7 @@ namespace System.Data.Common {
if (!allowDBNull)
col.AllowDBNull = false;
}
-
+
// This might not be set by all DataProviders
bool isHidden = false;
if (schemaTable.Columns.Contains ("IsHidden")) {
@@ -756,6 +775,7 @@ namespace System.Data.Common {
if (allowDBNull)
createPrimaryKey = false;
}
+
}
// add the ordinal of the column as a key and the index of the column in the datareader as a value.
mapping[col.Ordinal] = readerIndex++;
@@ -1129,6 +1149,9 @@ namespace System.Data.Common {
}
#endif
+ protected abstract void OnRowUpdated (RowUpdatedEventArgs value);
+ protected abstract void OnRowUpdating (RowUpdatingEventArgs value);
+
#endregion // Methods
}
}