using System.Text;
using System.Data;
using System.Data.Common;
-
using System.Runtime.InteropServices;
using System.Globalization;
-
-#if NET_2_0
-using System.Data.ProviderBase;
-#endif // NET_2_0
using System.ComponentModel;
namespace System.Data.Odbc
{
[TypeConverterAttribute (typeof (OdbcParameterConverter))]
#if NET_2_0
- public sealed class OdbcParameter : DbParameterBase, ICloneable
+ public sealed class OdbcParameter : DbParameter, ICloneable
#else
- public sealed class OdbcParameter : MarshalByRefObject, IDbDataParameter, IDataParameter, ICloneable
+ public sealed class OdbcParameter : MarshalByRefObject, IDbDataParameter, IDataParameter, ICloneable
#endif // NET_2_0
{
#region Fields
-#if ONLY_1_1
string name;
ParameterDirection direction;
bool isNullable;
byte _precision;
byte _scale;
object _value;
-#endif // ONLY_1_1
private OdbcTypeMap _typeMap;
private NativeBuffer _nativeBuffer = new NativeBuffer ();
{
_cbLengthInd = new NativeBuffer ();
ParameterName = String.Empty;
- IsNullable = true;
+ IsNullable = false;
SourceColumn = String.Empty;
Direction = ParameterDirection.Input;
- _typeMap = OdbcTypeConverter.GetTypeMap (OdbcType.VarChar);
+ _typeMap = OdbcTypeConverter.GetTypeMap (OdbcType.NVarChar);
}
public OdbcParameter (string name, object value)
{
this.ParameterName = name;
Value = value;
+ //FIXME: MS.net does not infer OdbcType from value unless a type is provided
_typeMap = OdbcTypeConverter.InferFromValue (value);
if (value != null && !value.GetType ().IsValueType) {
Type type = value.GetType ();
public
#if NET_2_0
override
-#endif // NET_2_0
+#endif
DbType DbType {
get { return _typeMap.DbType; }
set {
}
}
-#if ONLY_1_1
[OdbcCategory ("Data")]
[OdbcDescriptionAttribute ("Input, output, or bidirectional parameter")]
[DefaultValue (ParameterDirection.Input)]
- public ParameterDirection Direction {
+ public
+#if NET_2_0
+ override
+#endif
+ ParameterDirection Direction {
get { return direction; }
set { direction = value; }
}
[DesignOnlyAttribute (true)]
[EditorBrowsableAttribute (EditorBrowsableState.Advanced)]
[DefaultValue (false)]
- public bool IsNullable {
+ public
+#if NET_2_0
+ override
+#endif
+ bool IsNullable {
get { return isNullable; }
set { isNullable = value; }
}
-#endif // ONLY_1_1
[DefaultValue (OdbcType.NChar)]
}
}
-#if ONLY_1_1
[OdbcDescription ("DataParameter_ParameterName")]
[DefaultValue ("")]
- public string ParameterName {
+ public
+#if NET_2_0
+ override
+#endif
+ string ParameterName {
get { return name; }
set { name = value; }
}
[OdbcDescription ("DbDataParameter_Size")]
[OdbcCategory ("DataCategory_Data")]
[DefaultValue (0)]
- public int Size {
+ public
+#if NET_2_0
+ override
+#endif
+ int Size {
get { return size; }
set { size = value; }
}
[OdbcDescription ("DataParameter_SourceColumn")]
[OdbcCategory ("DataCategory_Data")]
[DefaultValue ("")]
- public string SourceColumn {
+ public
+#if NET_2_0
+ override
+#endif
+ string SourceColumn {
get { return sourceColumn; }
set { sourceColumn = value; }
}
[OdbcDescription ("DataParameter_SourceVersion")]
[OdbcCategory ("DataCategory_Data")]
[DefaultValue ("Current")]
- public DataRowVersion SourceVersion {
+ public
+#if NET_2_0
+ override
+#endif
+ DataRowVersion SourceVersion {
get { return sourceVersion; }
set { sourceVersion = value; }
}
[OdbcDescription ("DataParameter_Value")]
[OdbcCategory ("DataCategory_Data")]
[DefaultValue (null)]
- public object Value {
+ public
+#if NET_2_0
+ override
+#endif
+ object Value {
get {
return _value;
}
}
}
-#endif // ONLY_1_1
-
#endregion // Properties
#region Methods
}
#if NET_2_0
- [MonoTODO]
public override bool SourceColumnNullMapping {
get {return false;}
set {}
}
- [MonoTODO]
- public override void PropertyChanging ()
- {
- }
-
- [MonoTODO]
- protected override byte ValuePrecision (object value)
+ public override void ResetDbType ()
{
throw new NotImplementedException ();
}
+#endif
- [MonoTODO]
- protected override byte ValueScale (object value)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected override int ValueSize (object value)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override void ResetDbType ()
- {
- throw new NotImplementedException ();
- }
-
-#endif // NET_2_0
#endregion
}
}