+2002-08-11 Rodrigo Moya <rodrigo@ximian.com>
+
+ * System.Data.OleDb/libgda.cs: added some GdaValue functions.
+
+ * System.Data.OleDb/OleDbCommand.cs (OpenReader): removed this
+ internal method, since we don't need it.
+ (ExecuteReader): call SetupGdaCommand before executing the command
+ via libgda functions.
+ (ExecuteScalar): implemented.
+
+ * System.Data.OleDb/OleDbDateReader.cs (OleDbDataReader): removed call
+ to OleDbCommand.OpenReader.
+ (GetBoolean): implemented.
+
2002-08-08 Franklin Wise <gracenote@earthlink.net>
- * System.Data.IDbComand.cs: IDbCommand now inherits IDisposable
+ * System.Data/IDbComand.cs: IDbCommand now inherits IDisposable
- * System.Data.IDbConnection.cs: IDbConnection now inherits IDisposable
+ * System.Data/IDbConnection.cs: IDbConnection now inherits IDisposable
- * System.Data.SqlTypes.SqlCompareOptions.cs: Enum now set to correct
+ * System.Data.SqlTypes/SqlCompareOptions.cs: Enum now set to correct
values.
2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
public string CommandText
{
- get { return commandText; }
+ get {
+ return commandText;
+ }
set {
commandText = value;
}
}
public int CommandTimeout {
- get { return timeout; }
- set { timeout = value; }
+ get {
+ return timeout;
+ }
+ set {
+ timeout = value;
+ }
}
public CommandType CommandType {
- get { return commandType; }
- set { commandType = value; }
+ get {
+ return commandType;
+ }
+ set {
+ commandType = value;
+ }
}
public OleDbConnection Connection {
- get { return connection; }
- set { connection = value; }
+ get {
+ return connection;
+ }
+ set {
+ connection = value;
+ }
}
public bool DesignTimeVisible {
- get { return designTimeVisible; }
- set { designTimeVisible = value; }
+ get {
+ return designTimeVisible;
+ }
+ set {
+ designTimeVisible = value;
+ }
}
public OleDbParameterCollection Parameters {
- get { return parameters; }
- set { parameters = value; }
+ get {
+ return parameters;
+ }
+ set {
+ parameters = value;
+ }
}
public OleDbTransaction Transaction {
- get { return transaction; }
- set { transaction = value; }
+ get {
+ return transaction;
+ }
+ set {
+ transaction = value;
+ }
}
public UpdateRowSource UpdatedRowSource {
[MonoTODO]
- get { throw new NotImplementedException (); }
+ get {
+ throw new NotImplementedException ();
+ }
[MonoTODO]
- set { throw new NotImplementedException (); }
+ set {
+ throw new NotImplementedException ();
+ }
}
IDbConnection IDbCommand.Connection {
- get { return Connection; }
- set { Connection = (OleDbConnection) value; }
+ get {
+ return Connection;
+ }
+ set {
+ Connection = (OleDbConnection) value;
+ }
}
IDataParameterCollection IDbCommand.Parameters {
- get { return Parameters; }
+ get {
+ return Parameters;
+ }
}
IDbTransaction IDbCommand.Transaction {
- get { return Transaction; }
- set { Transaction = (OleDbTransaction) value; }
+ get {
+ return Transaction;
+ }
+ set {
+ Transaction = (OleDbTransaction) value;
+ }
}
#endregion // Properties
IntPtr gdaParameterList = parameters.GdaParameterList;
SetupGdaCommand ();
- return libgda.gda_connection_execute_non_query (gdaConnection, (IntPtr) gdaCommand, gdaParameterList);
+ return libgda.gda_connection_execute_non_query (gdaConnection,
+ (IntPtr) gdaCommand,
+ gdaParameterList);
}
public OleDbDataReader ExecuteReader ()
IntPtr gdaConnection = connection.GdaConnection;
IntPtr gdaParameterList = parameters.GdaParameterList;
+ SetupGdaCommand ();
/* FIXME: split all returned resultsets into the array
list of results */
results.Add (libgda.gda_connection_execute_command (
return ExecuteReader (behavior);
}
- [MonoTODO]
public object ExecuteScalar ()
{
- throw new NotImplementedException ();
+ SetupGdaCommand ();
+ OleDbDataReader reader = ExecuteReader ();
+ return reader.GetValue (0);
}
[MonoTODO]
}
#endregion
-
- #region Internal Methods
-
- // only meant to be used between OleDbConnection,
- // OleDbCommand, and OleDbDataReader
- internal void OpenReader (OleDbDataReader reader)
- {
- connection.OpenReader (reader);
- }
-
- #endregion
-
}
}
gdaResults = new ArrayList ();
currentResult = -1;
currentRow = -1;
- command.OpenReader(this);
isOpened = true;
}
public int Depth {
[MonoTODO]
- get { throw new NotImplementedException (); }
+ get {
+ throw new NotImplementedException ();
+ }
}
public int FieldCount {
throw new NotImplementedException ();
}
- [MonoTODO]
public bool GetBoolean (int ordinal)
{
- throw new NotImplementedException ();
+ IntPtr value;
+
+ if (currentResult == -1)
+ return false;
+
+ value = libgda.gda_data_model_get_value_at ((IntPtr) gdaResults[currentResult],
+ ordinal, currentRow);
+ if (value != IntPtr.Zero) {
+ if (libgda.gda_value_get_vtype (value) != GdaValueType.Boolean)
+ throw new InvalidCastException ();
+ return libgda.gda_value_get_boolean (value);
+ }
+
+ return false;
}
[MonoTODO]
return false;
}
- [MonoTODO]
public bool Read ()
{
throw new NotImplementedException ();