Author: adar
Date: 2007-05-10 11:06:42 -0400 (Thu, 10 May 2007)
New Revision: 77137
Modified:
trunk/mcs/class/System.Data/System.Data.SqlClient.jvm/ChangeLog
trunk/mcs/class/System.Data/System.Data.SqlClient.jvm/SqlCommand.cs
trunk/mcs/class/System.Data/System.Data.SqlClient.jvm/SqlConnection.cs
trunk/mcs/class/System.Data/System.Data.SqlClient.jvm/SqlDataReader.cs
trunk/mcs/class/System.Data/System.Data.SqlClient.jvm/SqlErrorCollection.cs
trunk/mcs/class/System.Data/System.Data.SqlClient.jvm/SqlParameter.cs
trunk/mcs/class/System.Data/System.Data.SqlClient.jvm/SqlParameterCollection.cs
trunk/mcs/class/System.Data/System.Data.SqlClient.jvm/SqlTransaction.cs
trunk/mcs/class/System.Data/System.Data.SqlTypes/ChangeLog
trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlBoolean.cs
trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlByte.cs
trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlBytes.cs
trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlChars.cs
trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlDateTime.cs
trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlXml.cs
Log:
2007-05-10 Adar Wesley <[EMAIL PROTECTED]>
* SqlBoolean.cs: fixed typo in method names GreaterThanOrEquals,
LessThanOrEquals.
* SqlByte.cs: added missing method Modulus.
* SqlBytes.cs: added missing methods Read, Write.
* SqlChars.cs: added missing methods ToSqlString, Write.
* SqlDateTime.cs: added missing methods Add, Subtract.
* SqlXml.cs: added missing method CreateReader.
* SqlCommand.cs: added missing methods Asynch operations
* SqlConnection.cs: added missing methods ChangePassword, ClearPool,
ClearAllPools, RetrieveStatistics, ResetStatistics.
* SqlDataReader.cs: added missing methods GetSqlBytes, GetSqlChars,
GetSqlXml, IsCommandBehavior.
* SqlErrorCollection.cs: added missing method strongly typed CopyTo.
* SqlParameter.cs: added missing methods ResetSqlDbType, ResetDbType.
* SqlParameterCollection.cs: added missing methods strongly typed
AddRange, IndexOf.
* SqlTransaction.cs: added missing methods Save, Rollback.
Modified: trunk/mcs/class/System.Data/System.Data.SqlClient.jvm/ChangeLog
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlClient.jvm/ChangeLog
2007-05-10 14:46:35 UTC (rev 77136)
+++ trunk/mcs/class/System.Data/System.Data.SqlClient.jvm/ChangeLog
2007-05-10 15:06:42 UTC (rev 77137)
@@ -1,3 +1,22 @@
+2007-05-10 Adar Wesley <[EMAIL PROTECTED]>
+
+ * SqlCommand.cs: added missing methods Asynch operations
+
+ * SqlConnection.cs: added missing methods ChangePassword, ClearPool,
+ ClearAllPools, RetrieveStatistics, ResetStatistics.
+
+ * SqlDataReader.cs: added missing methods GetSqlBytes, GetSqlChars,
+ GetSqlXml, IsCommandBehavior.
+
+ * SqlErrorCollection.cs: added missing method strongly typed CopyTo.
+
+ * SqlParameter.cs: added missing methods ResetSqlDbType, ResetDbType.
+
+ * SqlParameterCollection.cs: added missing methods strongly typed
+ AddRange, IndexOf.
+
+ * SqlTransaction.cs: added missing methods Save, Rollback.
+
2006-08-24 Konstantin Triger <[EMAIL PROTECTED]>
* SqlCommand, SqlParameter.cs: correctly resolve parameters without '@'.
Modified: trunk/mcs/class/System.Data/System.Data.SqlClient.jvm/SqlCommand.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlClient.jvm/SqlCommand.cs
2007-05-10 14:46:35 UTC (rev 77136)
+++ trunk/mcs/class/System.Data/System.Data.SqlClient.jvm/SqlCommand.cs
2007-05-10 15:06:42 UTC (rev 77137)
@@ -1,6 +1,6 @@
-//
-// System.Data.SqlClient.SqlCommand
//
+// System.Data.SqlClient.SqlCommand
+//
// Authors:
// Konstantin Triger <[EMAIL PROTECTED]>
// Boris Kirzner <[EMAIL PROTECTED]>
@@ -104,38 +104,38 @@
}
}
- public new SqlConnection Connection
- {
- get { return (SqlConnection)base.Connection; }
- set { base.Connection = value; }
+ public new SqlConnection Connection
+ {
+ get { return (SqlConnection)base.Connection; }
+ set { base.Connection = value; }
}
- public new SqlParameterCollection Parameters
- {
- get {
- return (SqlParameterCollection)base.Parameters;
- }
+ public new SqlParameterCollection Parameters
+ {
+ get {
+ return (SqlParameterCollection)base.Parameters;
+ }
}
- public new SqlTransaction Transaction
- {
- get { return (SqlTransaction)base.Transaction; }
- set { base.Transaction = value; }
+ public new SqlTransaction Transaction
+ {
+ get { return (SqlTransaction)base.Transaction; }
+ set { base.Transaction = value; }
}
-#if USE_DOTNET_REGEX
- protected override Regex StoredProcedureRegExp
-#else
- protected override java.util.regex.Pattern
StoredProcedureRegExp {
-#endif
- get { return
SqlStatementsHelper.NamedParameterStoredProcedureRegExp; }
- }
-
- protected override SimpleRegex ParameterRegExp
- {
- get { return SqlStatementsHelper.NamedParameterRegExp; }
+#if USE_DOTNET_REGEX
+ protected override Regex StoredProcedureRegExp
+#else
+ protected override java.util.regex.Pattern
StoredProcedureRegExp {
+#endif
+ get { return
SqlStatementsHelper.NamedParameterStoredProcedureRegExp; }
}
+ protected override SimpleRegex ParameterRegExp
+ {
+ get { return SqlStatementsHelper.NamedParameterRegExp; }
+ }
+
#endregion // Properties
#region Methods
@@ -144,75 +144,144 @@
return
SqlXmlTextReader.Create(ExecuteReader(CommandBehavior.SequentialAccess));
}
- public new SqlDataReader ExecuteReader()
- {
- return
(SqlDataReader)ExecuteReader(CommandBehavior.Default);
+ public new SqlDataReader ExecuteReader()
+ {
+ return
(SqlDataReader)ExecuteReader(CommandBehavior.Default);
}
- public new SqlDataReader ExecuteReader(CommandBehavior behavior)
- {
- return (SqlDataReader)base.ExecuteReader(behavior);
+ public new SqlDataReader ExecuteReader(CommandBehavior behavior)
+ {
+ return (SqlDataReader)base.ExecuteReader(behavior);
}
-
- public new SqlParameter CreateParameter()
- {
- return (SqlParameter)CreateParameterInternal();
- }
-
- protected sealed override void CheckParameters()
- {
- // do nothing
- }
-
- protected override AbstractDbParameter GetUserParameter(string
parameterName, IList userParametersList, int userParametersListPosition/*,int
userParametersListStart,int userParameterListCount*/)
- {
+
+ public new SqlParameter CreateParameter()
+ {
+ return (SqlParameter)CreateParameterInternal();
+ }
+
+ protected sealed override void CheckParameters()
+ {
+ // do nothing
+ }
+
+ protected override AbstractDbParameter GetUserParameter(string
parameterName, IList userParametersList, int userParametersListPosition/*,int
userParametersListStart,int userParameterListCount*/)
+ {
// Match match =
SqlStatementsHelper.NamedParameterRegExp.Match(parameterName);
-// parameterName = match.Result("${USERPARAM}");
-// if (parameterName.Length == 0)
-// return null;
-
- for(int i=0; i < userParametersList.Count; i++) {
- AbstractDbParameter userParameter =
(AbstractDbParameter)userParametersList[i];
- if (String.Compare(parameterName,
userParameter.Placeholder.Trim(), true,
System.Globalization.CultureInfo.InvariantCulture) == 0) {
- return userParameter;
- }
- }
-
- return null;
- }
-
- protected override AbstractDbParameter GetReturnParameter
(IList userParametersList)
- {
- for(int i=0; i < userParametersList.Count; i++) {
- AbstractDbParameter userParameter =
(AbstractDbParameter)userParametersList[i];
- if (userParameter.Direction ==
ParameterDirection.ReturnValue) {
- return userParameter;
- }
- }
-
- return null;
- }
-
- protected sealed override DbParameter CreateParameterInternal()
- {
- return new SqlParameter();
- }
-
- protected sealed override DbDataReader CreateReader()
- {
- return new SqlDataReader(this);
- }
-
- protected sealed override DbParameterCollection
CreateParameterCollection(AbstractDbCommand parent)
- {
- return new SqlParameterCollection((SqlCommand)parent);
- }
-
+// parameterName = match.Result("${USERPARAM}");
+// if (parameterName.Length == 0)
+// return null;
+
+ for(int i=0; i < userParametersList.Count; i++) {
+ AbstractDbParameter userParameter =
(AbstractDbParameter)userParametersList[i];
+ if (String.Compare(parameterName,
userParameter.Placeholder.Trim(), true,
System.Globalization.CultureInfo.InvariantCulture) == 0) {
+ return userParameter;
+ }
+ }
+
+ return null;
+ }
+
+ protected override AbstractDbParameter GetReturnParameter
(IList userParametersList)
+ {
+ for(int i=0; i < userParametersList.Count; i++) {
+ AbstractDbParameter userParameter =
(AbstractDbParameter)userParametersList[i];
+ if (userParameter.Direction ==
ParameterDirection.ReturnValue) {
+ return userParameter;
+ }
+ }
+
+ return null;
+ }
+
+ protected sealed override DbParameter CreateParameterInternal()
+ {
+ return new SqlParameter();
+ }
+
+ protected sealed override DbDataReader CreateReader()
+ {
+ return new SqlDataReader(this);
+ }
+
+ protected sealed override DbParameterCollection
CreateParameterCollection(AbstractDbCommand parent)
+ {
+ return new SqlParameterCollection((SqlCommand)parent);
+ }
+
protected internal sealed override SystemException
CreateException(SQLException e)
- {
- return new SqlException(e, Connection);
+ {
+ return new SqlException(e, Connection);
}
- #endregion // Methods
+ #region Asynchronous behavior
+#if NET_2_0
+ [MonoNotSupported ("Asynchronous behavior not implemented")]
+ public IAsyncResult BeginExecuteReader ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoNotSupported ("Asynchronous behavior not implemented")]
+ public IAsyncResult BeginExecuteReader (CommandBehavior
behavior)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoNotSupported ("Asynchronous behavior not implemented")]
+ public IAsyncResult BeginExecuteReader (AsyncCallback callback,
Object stateObject)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoNotSupported ("Asynchronous behavior not implemented")]
+ public IAsyncResult BeginExecuteReader (AsyncCallback callback,
Object stateObject, CommandBehavior behavior)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoNotSupported ("Asynchronous behavior not implemented")]
+ public SqlDataReader EndExecuteReader (IAsyncResult asyncResult)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoNotSupported ("Asynchronous behavior not implemented")]
+ public IAsyncResult BeginExecuteXmlReader ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoNotSupported ("Asynchronous behavior not implemented")]
+ public IAsyncResult BeginExecuteXmlReader (AsyncCallback
callback, Object stateObject)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoNotSupported ("Asynchronous behavior not implemented")]
+ public XmlReader EndExecuteXmlReader (IAsyncResult asyncResult)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoNotSupported ("Asynchronous behavior not implemented")]
+ public IAsyncResult BeginExecuteNonQuery ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoNotSupported ("Asynchronous behavior not implemented")]
+ public IAsyncResult BeginExecuteNonQuery (AsyncCallback
callback, Object stateObject)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoNotSupported ("Asynchronous behavior not implemented")]
+ public int EndExecuteNonQuery (IAsyncResult asyncResult)
+ {
+ throw new NotImplementedException ();
+ }
+#endif
+ #endregion
+ #endregion // Methods
}
}
Modified: trunk/mcs/class/System.Data/System.Data.SqlClient.jvm/SqlConnection.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlClient.jvm/SqlConnection.cs
2007-05-10 14:46:35 UTC (rev 77136)
+++ trunk/mcs/class/System.Data/System.Data.SqlClient.jvm/SqlConnection.cs
2007-05-10 15:06:42 UTC (rev 77137)
@@ -1,171 +1,234 @@
-//
-// System.Data.SqlClient.SqlConnection
-//
-// Authors:
-// Konstantin Triger <[EMAIL PROTECTED]>
-// Boris Kirzner <[EMAIL PROTECTED]>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// 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;
-using System.Data.Common;
-using System.Collections;
-using System.Data.ProviderBase;
-
-using java.sql;
-
-using System.Configuration;
-using Mainsoft.Data.Configuration;
-using Mainsoft.Data.Jdbc.Providers;
-
-namespace System.Data.SqlClient
-{
- public class SqlConnection : AbstractDBConnection
- {
- #region Fields
-
- private const int DEFAULT_PACKET_SIZE = 8192;
-
- #endregion // Fields
-
- #region Constructors
-
- public SqlConnection() : this(null)
- {
- }
-
- public SqlConnection(String connectionString) :
base(connectionString)
- {
- }
-
- #endregion // Constructors
-
- #region Events
-
- [DataCategory ("InfoMessage")]
- [DataSysDescription ("Event triggered when messages arrive from
the DataSource.")]
- public event SqlInfoMessageEventHandler InfoMessage;
-
- #endregion // Events
-
- #region Properties
-
- public string WorkstationId
- {
- get { return
(string)ConnectionStringBuilder["workstation id"]; }
- }
-
- public int PacketSize
- {
- get {
- string packetSize =
(string)ConnectionStringBuilder["Packet Size"];
- if (packetSize == null || packetSize.Length ==
0) {
- return DEFAULT_PACKET_SIZE;
- }
- try {
- return Convert.ToInt32(packetSize);
- }
- catch(FormatException e) {
- throw
ExceptionHelper.InvalidValueForKey("packet size");
- }
- catch (OverflowException e) {
- throw
ExceptionHelper.InvalidValueForKey("packet size");
- }
- }
- }
-
- protected override IConnectionProvider GetConnectionProvider() {
- IDictionary conProviderDict =
ConnectionStringDictionary.Parse(ConnectionString);
- string provider = (string)conProviderDict["Provider"];
- if (provider == null)
- provider = "SQLCLIENT";
-
- return
GetConnectionProvider("Mainsoft.Data.Configuration/SqlClientProviders",
provider);
- }
-
- #endregion // Properties
-
- #region Methods
-
- protected override DbTransaction
BeginDbTransaction(IsolationLevel isolationLevel) {
- return BeginTransaction(isolationLevel);
- }
-
- public SqlTransaction BeginTransaction(String transactionName)
- {
- return
BeginTransaction(IsolationLevel.ReadCommitted,transactionName);
- }
-
- public new SqlTransaction BeginTransaction(IsolationLevel
isolationLevel)
- {
- return BeginTransaction(isolationLevel,"Transaction");
- }
-
- public new SqlTransaction BeginTransaction()
- {
- return BeginTransaction(IsolationLevel.ReadCommitted);
- }
-
- public SqlTransaction BeginTransaction(IsolationLevel
isolationLevel, string transactionName)
- {
- return new SqlTransaction(isolationLevel, this,
transactionName);
- }
-
- public new SqlCommand CreateCommand()
- {
- return new SqlCommand(this);
- }
-
- protected override DbCommand CreateDbCommand() {
- return CreateCommand();
- }
-
- protected internal sealed override void OnSqlWarning(SQLWarning
warning)
- {
- SqlErrorCollection col = new
SqlErrorCollection(warning, this);
- OnSqlInfoMessage(new SqlInfoMessageEventArgs(col));
- }
-
- protected sealed override SystemException
CreateException(SQLException e)
- {
- return new SqlException(e, this);
- }
-
- protected sealed override SystemException
CreateException(string message)
- {
- return new SqlException(message, null, this);
- }
-
- private void OnSqlInfoMessage (SqlInfoMessageEventArgs value)
- {
- if (InfoMessage != null) {
- InfoMessage (this, value);
- }
- }
-
- #endregion // Methods
-
- }
-}
+//
+// System.Data.SqlClient.SqlConnection
+//
+// Authors:
+// Konstantin Triger <[EMAIL PROTECTED]>
+// Boris Kirzner <[EMAIL PROTECTED]>
+//
+// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
+//
+
+//
+// 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;
+using System.Data.Common;
+using System.Collections;
+using System.Data.ProviderBase;
+
+using java.sql;
+
+using System.Configuration;
+using Mainsoft.Data.Configuration;
+using Mainsoft.Data.Jdbc.Providers;
+
+namespace System.Data.SqlClient
+{
+ public class SqlConnection : AbstractDBConnection
+ {
+ #region Fields
+
+ private const int DEFAULT_PACKET_SIZE = 8192;
+
+ #endregion // Fields
+
+ #region Constructors
+
+ public SqlConnection() : this(null)
+ {
+ }
+
+ public SqlConnection(String connectionString) :
base(connectionString)
+ {
+ }
+
+ #endregion // Constructors
+
+ #region Events
+
+ [DataCategory ("InfoMessage")]
+ [DataSysDescription ("Event triggered when messages arrive from
the DataSource.")]
+ public event SqlInfoMessageEventHandler InfoMessage;
+
+ #endregion // Events
+
+ #region Properties
+
+ public string WorkstationId
+ {
+ get { return
(string)ConnectionStringBuilder["workstation id"]; }
+ }
+
+ public int PacketSize
+ {
+ get {
+ string packetSize =
(string)ConnectionStringBuilder["Packet Size"];
+ if (packetSize == null || packetSize.Length ==
0) {
+ return DEFAULT_PACKET_SIZE;
+ }
+ try {
+ return Convert.ToInt32(packetSize);
+ }
+ catch(FormatException e) {
+ throw
ExceptionHelper.InvalidValueForKey("packet size");
+ }
+ catch (OverflowException e) {
+ throw
ExceptionHelper.InvalidValueForKey("packet size");
+ }
+ }
+ }
+
+ protected override IConnectionProvider GetConnectionProvider() {
+ IDictionary conProviderDict =
ConnectionStringDictionary.Parse(ConnectionString);
+ string provider = (string)conProviderDict["Provider"];
+ if (provider == null)
+ provider = "SQLCLIENT";
+
+ return
GetConnectionProvider("Mainsoft.Data.Configuration/SqlClientProviders",
provider);
+ }
+
+ #endregion // Properties
+
+ #region Methods
+
+ protected override DbTransaction
BeginDbTransaction(IsolationLevel isolationLevel) {
+ return BeginTransaction(isolationLevel);
+ }
+
+ public SqlTransaction BeginTransaction(String transactionName)
+ {
+ return
BeginTransaction(IsolationLevel.ReadCommitted,transactionName);
+ }
+
+ public new SqlTransaction BeginTransaction(IsolationLevel
isolationLevel)
+ {
+ return BeginTransaction(isolationLevel,"Transaction");
+ }
+
+ public new SqlTransaction BeginTransaction()
+ {
+ return BeginTransaction(IsolationLevel.ReadCommitted);
+ }
+
+ public SqlTransaction BeginTransaction(IsolationLevel
isolationLevel, string transactionName)
+ {
+ return new SqlTransaction(isolationLevel, this,
transactionName);
+ }
+
+ public new SqlCommand CreateCommand()
+ {
+ return new SqlCommand(this);
+ }
+
+ protected override DbCommand CreateDbCommand() {
+ return CreateCommand();
+ }
+
+ protected internal sealed override void OnSqlWarning(SQLWarning
warning)
+ {
+ SqlErrorCollection col = new
SqlErrorCollection(warning, this);
+ OnSqlInfoMessage(new SqlInfoMessageEventArgs(col));
+ }
+
+ protected sealed override SystemException
CreateException(SQLException e)
+ {
+ return new SqlException(e, this);
+ }
+
+ protected sealed override SystemException
CreateException(string message)
+ {
+ return new SqlException(message, null, this);
+ }
+
+ private void OnSqlInfoMessage (SqlInfoMessageEventArgs value)
+ {
+ if (InfoMessage != null) {
+ InfoMessage (this, value);
+ }
+ }
+
+#if NET_2_0
+
+ [MonoNotSupported("")]
+ public static void ChangePassword (string connectionString,
string newPassword)
+ {
+ throw new NotImplementedException ();
+
+ // FIXME: refactored from Mono implementation. Not
finished!!!
+ if (connectionString == null || newPassword == null ||
newPassword == String.Empty)
+ throw new ArgumentNullException ();
+ if (newPassword.Length > 128)
+ throw new ArgumentException ("The value of
newPassword exceeds its permittable length which is 128");
+
+ SqlConnectionStringBuilder builder = new
SqlConnectionStringBuilder (connectionString);
+ if (builder.IntegratedSecurity) {
+ throw new ArgumentException ("Can't use
integrated security when changing password");
+ }
+
+ using (SqlConnection conn = new SqlConnection
(connectionString)) {
+ conn.Open ();
+ SqlCommand cmd = conn.CreateCommand ();
+ cmd.CommandText = "sp_password";
+ cmd.CommandType = CommandType.StoredProcedure;
+ // FIXME: Need to extract old password and user
from our structures
+ // of the connectionString.
+ cmd.Parameters.Add (builder.Password); // Is
this good???
+ cmd.Parameters.Add (newPassword);
+ cmd.Parameters.Add (builder.UserID); // Is this
good???
+ cmd.ExecuteNonQuery();
+ }
+ }
+
+ #region Pooling
+
+ [MonoNotSupported("Pooling not supported")]
+ public static void ClearPool (SqlConnection connection)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoNotSupported ("Pooling not supported")]
+ public static void ClearAllPools ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ #endregion
+ #region Statistics
+
+ [MonoNotSupported ("Statistics not supported")]
+ public IDictionary RetrieveStatistics ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoNotSupported ("Statistics not supported")]
+ public void ResetStatistics ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ #endregion
+#endif
+ #endregion // Methods
+
+ }
+}
Modified: trunk/mcs/class/System.Data/System.Data.SqlClient.jvm/SqlDataReader.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlClient.jvm/SqlDataReader.cs
2007-05-10 14:46:35 UTC (rev 77136)
+++ trunk/mcs/class/System.Data/System.Data.SqlClient.jvm/SqlDataReader.cs
2007-05-10 15:06:42 UTC (rev 77137)
@@ -1,6 +1,6 @@
-//
-// System.Data.SqlClient.SqlDataReader
//
+// System.Data.SqlClient.SqlDataReader
+//
// Authors:
// Konstantin Triger <[EMAIL PROTECTED]>
// Boris Kirzner <[EMAIL PROTECTED]>
@@ -53,28 +53,28 @@
#region Methods
- protected sealed override SystemException
CreateException(string message, SQLException e)
- {
- return new SqlException(message, e,
(SqlConnection)_command.Connection);
- }
-
- protected sealed override SystemException
CreateException(java.io.IOException e)
- {
- return new SqlException(e,
(SqlConnection)_command.Connection);
- }
-
- public override String GetDataTypeName(int columnIndex)
- {
- try {
- string jdbcTypeName =
Results.getMetaData().getColumnTypeName(columnIndex + 1);
-
- return
SqlConvert.JdbcTypeNameToDbTypeName(jdbcTypeName);
- }
- catch (SQLException e) {
- throw CreateException(e);
- }
- }
-
+ protected sealed override SystemException
CreateException(string message, SQLException e)
+ {
+ return new SqlException(message, e,
(SqlConnection)_command.Connection);
+ }
+
+ protected sealed override SystemException
CreateException(java.io.IOException e)
+ {
+ return new SqlException(e,
(SqlConnection)_command.Connection);
+ }
+
+ public override String GetDataTypeName(int columnIndex)
+ {
+ try {
+ string jdbcTypeName =
Results.getMetaData().getColumnTypeName(columnIndex + 1);
+
+ return
SqlConvert.JdbcTypeNameToDbTypeName(jdbcTypeName);
+ }
+ catch (SQLException e) {
+ throw CreateException(e);
+ }
+ }
+
protected override int GetProviderType(int jdbcType)
{
return (int)SqlConvert.JdbcTypeToSqlDbType(jdbcType);
@@ -100,7 +100,7 @@
return SqlBoolean.Null;
}
else {
- return new SqlBoolean(boolean);
+ return new SqlBoolean(boolean);
}
}
@@ -111,12 +111,43 @@
if(IsDBNull(columnIndex)) {
return SqlByte.Null;
}
- else {
- return new SqlByte(byt);
+ else {
+ return new SqlByte(byt);
}
}
+#if NET_2_0
+ public virtual SqlBytes GetSqlBytes (int columnIndex)
+ {
+ byte [] bytes = GetBytes (columnIndex);
+ if (IsDBNull (columnIndex)) {
+ return SqlBytes.Null;
+ }
+ else {
+ return new SqlBytes (bytes);
+ }
+ }
+
+ public virtual SqlChars GetSqlChars (int columnIndex)
+ {
+ SqlString sqlStr = GetSqlString (columnIndex);
+ if (sqlStr.IsNull) {
+ return SqlChars.Null;
+ }
+ else {
+ return new SqlChars (sqlStr);
+ }
+ }
+
+ [MonoNotSupported("SqlXml is not fully implemented")]
+ public virtual SqlXml GetSqlXml (int columnIndex)
+ {
+ throw new NotImplementedException ();
+ }
+
+#endif
+
// Gets the value of the specified column as a SqlDecimal.
public SqlDecimal GetSqlDecimal(int columnIndex)
{
@@ -124,8 +155,8 @@
if(IsDBNull(columnIndex)) {
return SqlDecimal.Null;
}
- else {
- return new SqlDecimal(dec);
+ else {
+ return new SqlDecimal(dec);
}
}
@@ -136,8 +167,8 @@
if(IsDBNull(columnIndex)) {
return SqlDateTime.Null;
}
- else {
- return new SqlDateTime(dateTime);
+ else {
+ return new SqlDateTime(dateTime);
}
}
@@ -148,8 +179,8 @@
if(IsDBNull(columnIndex)) {
return SqlDouble.Null;
}
- else {
- return new SqlDouble(doubl);
+ else {
+ return new SqlDouble(doubl);
}
}
@@ -160,8 +191,8 @@
if(IsDBNull(columnIndex)) {
return SqlInt16.Null;
}
- else {
- return new SqlInt16(s);
+ else {
+ return new SqlInt16(s);
}
}
@@ -172,8 +203,8 @@
if(IsDBNull(columnIndex)) {
return SqlInt32.Null;
}
- else {
- return new SqlInt32(i);
+ else {
+ return new SqlInt32(i);
}
}
@@ -184,8 +215,8 @@
if(IsDBNull(columnIndex)) {
return SqlInt64.Null;
}
- else {
- return new SqlInt64(l);
+ else {
+ return new SqlInt64(l);
}
}
@@ -208,8 +239,8 @@
if(IsDBNull(columnIndex)) {
return SqlSingle.Null;
}
- else {
- return new SqlSingle(f);
+ else {
+ return new SqlSingle(f);
}
}
@@ -220,8 +251,8 @@
if(IsDBNull(columnIndex)) {
return SqlString.Null;
}
- else {
- return new SqlString(str);
+ else {
+ return new SqlString(str);
}
}
@@ -232,13 +263,13 @@
if(IsDBNull(columnIndex)) {
return SqlGuid.Null;
}
- else {
- if (obj is byte[]) {
- return new SqlGuid((byte[])obj);
- }
- else {
- return new SqlGuid((string)obj);
- }
+ else {
+ if (obj is byte[]) {
+ return new SqlGuid((byte[])obj);
+ }
+ else {
+ return new SqlGuid((string)obj);
+ }
}
}
@@ -260,32 +291,32 @@
int jdbcType =
ResultsMetaData.getColumnType(columnIndex + 1);
SqlDbType sqlDbType =
SqlConvert.JdbcTypeToSqlDbType(jdbcType);
- switch (sqlDbType) {
- case SqlDbType.BigInt : return
GetSqlInt64(columnIndex);
- case SqlDbType.Binary : return
GetSqlBinary(columnIndex);
- case SqlDbType.Bit : return
GetSqlBoolean(columnIndex);
- case SqlDbType.Char : return
GetSqlString(columnIndex);
- case SqlDbType.DateTime : return
GetSqlDateTime(columnIndex);
- case SqlDbType.Decimal : return
GetSqlDecimal(columnIndex);
- case SqlDbType.Float : return
GetSqlDouble(columnIndex);
- case SqlDbType.Image : return
GetSqlBinary(columnIndex);
- case SqlDbType.Int : return
GetSqlInt32(columnIndex);
- case SqlDbType.Money : return
GetSqlDecimal(columnIndex);
- case SqlDbType.NChar : return
GetSqlString(columnIndex);
- case SqlDbType.NText : return
GetSqlString(columnIndex);
- case SqlDbType.NVarChar : return
GetSqlString(columnIndex);
- case SqlDbType.Real : return
GetSqlSingle(columnIndex);
- case SqlDbType.UniqueIdentifier :
return GetSqlGuid(columnIndex);
- case SqlDbType.SmallDateTime : return
GetSqlDateTime(columnIndex);
- case SqlDbType.SmallInt : return
GetSqlInt16(columnIndex);
- case SqlDbType.SmallMoney : return
GetSqlDecimal(columnIndex);
- case SqlDbType.Text : return
GetSqlString(columnIndex);
- case SqlDbType.Timestamp : return
GetSqlDateTime(columnIndex);
- case SqlDbType.TinyInt : return
GetSqlByte(columnIndex);
- case SqlDbType.VarBinary : return
GetSqlBinary(columnIndex);
- case SqlDbType.VarChar : return
GetSqlString(columnIndex);
- case SqlDbType.Variant : return
GetValue(columnIndex);
- default : return GetValue(columnIndex);
+ switch (sqlDbType) {
+ case SqlDbType.BigInt : return
GetSqlInt64(columnIndex);
+ case SqlDbType.Binary : return
GetSqlBinary(columnIndex);
+ case SqlDbType.Bit : return
GetSqlBoolean(columnIndex);
+ case SqlDbType.Char : return
GetSqlString(columnIndex);
+ case SqlDbType.DateTime : return
GetSqlDateTime(columnIndex);
+ case SqlDbType.Decimal : return
GetSqlDecimal(columnIndex);
+ case SqlDbType.Float : return
GetSqlDouble(columnIndex);
+ case SqlDbType.Image : return
GetSqlBinary(columnIndex);
+ case SqlDbType.Int : return
GetSqlInt32(columnIndex);
+ case SqlDbType.Money : return
GetSqlDecimal(columnIndex);
+ case SqlDbType.NChar : return
GetSqlString(columnIndex);
+ case SqlDbType.NText : return
GetSqlString(columnIndex);
+ case SqlDbType.NVarChar : return
GetSqlString(columnIndex);
+ case SqlDbType.Real : return
GetSqlSingle(columnIndex);
+ case SqlDbType.UniqueIdentifier :
return GetSqlGuid(columnIndex);
+ case SqlDbType.SmallDateTime : return
GetSqlDateTime(columnIndex);
+ case SqlDbType.SmallInt : return
GetSqlInt16(columnIndex);
+ case SqlDbType.SmallMoney : return
GetSqlDecimal(columnIndex);
+ case SqlDbType.Text : return
GetSqlString(columnIndex);
+ case SqlDbType.Timestamp : return
GetSqlDateTime(columnIndex);
+ case SqlDbType.TinyInt : return
GetSqlByte(columnIndex);
+ case SqlDbType.VarBinary : return
GetSqlBinary(columnIndex);
+ case SqlDbType.VarChar : return
GetSqlString(columnIndex);
+ case SqlDbType.Variant : return
GetValue(columnIndex);
+ default : return GetValue(columnIndex);
}
}
catch (SQLException exp) {
@@ -293,6 +324,12 @@
}
}
+#if NET_2_0
+ protected bool IsCommandBehavior (CommandBehavior condition)
+ {
+ return (_command.Behavior & condition) == condition;
+ }
+#endif
#endregion // Methods
}
}
\ No newline at end of file
Modified:
trunk/mcs/class/System.Data/System.Data.SqlClient.jvm/SqlErrorCollection.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlClient.jvm/SqlErrorCollection.cs
2007-05-10 14:46:35 UTC (rev 77136)
+++ trunk/mcs/class/System.Data/System.Data.SqlClient.jvm/SqlErrorCollection.cs
2007-05-10 15:06:42 UTC (rev 77137)
@@ -1,6 +1,6 @@
-//
-// System.Data.SqlClient.SqlErrorCollection
//
+// System.Data.SqlClient.SqlErrorCollection
+//
// Authors:
// Konstantin Triger <[EMAIL PROTECTED]>
// Boris Kirzner <[EMAIL PROTECTED]>
@@ -52,18 +52,26 @@
* @param index of the error
* @return Error on specified index
*/
- public SqlError this[int index]
- {
- get
- {
- return (SqlError)GetDbItem(index);
- }
- }
-
- protected override AbstractDbError
CreateDbError(java.sql.SQLException e, AbstractDBConnection connection) {
- return new SqlError(e, connection);
- }
-
+ public SqlError this[int index]
+ {
+ get
+ {
+ return (SqlError)GetDbItem(index);
+ }
+ }
+
+#if NET_2_0
+ public void CopyTo (SqlError [] array, int index)
+ {
+ base.CopyTo (array, index);
+ }
+
+#endif
+
+ protected override AbstractDbError
CreateDbError(java.sql.SQLException e, AbstractDBConnection connection) {
+ return new SqlError(e, connection);
+ }
+
}
}
\ No newline at end of file
Modified: trunk/mcs/class/System.Data/System.Data.SqlClient.jvm/SqlParameter.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlClient.jvm/SqlParameter.cs
2007-05-10 14:46:35 UTC (rev 77136)
+++ trunk/mcs/class/System.Data/System.Data.SqlClient.jvm/SqlParameter.cs
2007-05-10 15:06:42 UTC (rev 77137)
@@ -1,6 +1,6 @@
-//
-// System.Data.SqlClient.SqlParameter
//
+// System.Data.SqlClient.SqlParameter
+//
// Authors:
// Konstantin Triger <[EMAIL PROTECTED]>
// Boris Kirzner <[EMAIL PROTECTED]>
@@ -90,23 +90,23 @@
{
}
-#if NET_2_0
- 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,
sourceColumnNullMapping, precision, scale, sourceColumn, sourceVersion, value,
true)
- {
+#if NET_2_0
+ 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,
sourceColumnNullMapping, precision, scale, sourceColumn, sourceVersion, value,
true)
+ {
}
#endif
@@ -142,19 +142,19 @@
#region Properties
- public override DbType DbType
- {
- get { return SqlConvert.SqlDbTypeToDbType(_sqlDbType); }
- set { SqlDbType = SqlConvert.DbTypeToSqlDbType(value); }
- }
-
- public SqlDbType SqlDbType
- {
- get { return _sqlDbType; }
- set {
- _sqlDbType = value;
- IsDbTypeSet = true;
- }
+ public override DbType DbType
+ {
+ get { return SqlConvert.SqlDbTypeToDbType(_sqlDbType); }
+ set { SqlDbType = SqlConvert.DbTypeToSqlDbType(value); }
+ }
+
+ public SqlDbType SqlDbType
+ {
+ get { return _sqlDbType; }
+ set {
+ _sqlDbType = value;
+ IsDbTypeSet = true;
+ }
}
public override int Size
@@ -177,36 +177,36 @@
}
}
-#if NET_2_0
+#if NET_2_0
public new byte Precision
{
- get { return base.Precision; }
+ get { return base.Precision; }
set { base.Precision = value; }
}
public new byte Scale
{
- get { return base.Scale; }
+ get { return base.Scale; }
set { base.Scale = value; }
- }
+ }
#endif
- protected internal override string Placeholder {
- get {
+ protected internal override string Placeholder {
+ get {
if (ParameterName.Length == 0 ||
ParameterName[0] == '@')
return ParameterName;
return String.Concat("@", ParameterName);
- }
- }
+ }
+ }
public override Object Value
{
get { return base.Value; }
set {
- if (!IsDbTypeSet && (value != null) && (value
!= DBNull.Value)) {
- _sqlDbType =
SqlConvert.ValueTypeToSqlDbType(value.GetType());
+ if (!IsDbTypeSet && (value != null) && (value
!= DBNull.Value)) {
+ _sqlDbType =
SqlConvert.ValueTypeToSqlDbType(value.GetType());
}
base.Value = value;
}
@@ -216,43 +216,55 @@
#region Methods
- protected internal sealed override object ConvertValue(object
value)
- {
- // can not convert null or DbNull to other types
- if (value == null || value == DBNull.Value) {
- return value;
- }
- // .NET throws an exception to the user.
- object convertedValue = value is IConvertible ?
Convert.ChangeType(value,SqlConvert.SqlDbTypeToValueType(SqlDbType)) : value;
- return convertedValue;
+ protected internal sealed override object ConvertValue(object
value)
+ {
+ // can not convert null or DbNull to other types
+ if (value == null || value == DBNull.Value) {
+ return value;
+ }
+ // .NET throws an exception to the user.
+ object convertedValue = value is IConvertible ?
Convert.ChangeType(value,SqlConvert.SqlDbTypeToValueType(SqlDbType)) : value;
+ return convertedValue;
}
- protected internal sealed override void
SetParameterName(ResultSet res)
- {
- string name = res.getString("COLUMN_NAME");
- if (name != null && name.Length > 0 && name[0] != '@')
- name = String.Concat("@", name);
- ParameterName = name;
- }
-
- protected internal sealed override void
SetParameterDbType(ResultSet res)
- {
- int dataType = res.getInt("DATA_TYPE");
- SqlDbType = SqlConvert.JdbcTypeToSqlDbType(dataType);
- JdbcType = dataType;
- }
-
- protected internal sealed override void
SetSpecialFeatures(ResultSet res)
- {
- // do nothing
+ protected internal sealed override void
SetParameterName(ResultSet res)
+ {
+ string name = res.getString("COLUMN_NAME");
+ if (name != null && name.Length > 0 && name[0] != '@')
+ name = String.Concat("@", name);
+ ParameterName = name;
}
- protected internal sealed override int
JdbcTypeFromProviderType()
- {
- return SqlConvert.SqlDbTypeToJdbcType(SqlDbType);
+ protected internal sealed override void
SetParameterDbType(ResultSet res)
+ {
+ int dataType = res.getInt("DATA_TYPE");
+ SqlDbType = SqlConvert.JdbcTypeToSqlDbType(dataType);
+ JdbcType = dataType;
}
- #endregion // Methods
-
+#if NET_2_0
+ public void ResetSqlDbType ()
+ {
+ IsDbTypeSet = false;
+ }
+
+ public override void ResetDbType ()
+ {
+ ResetSqlDbType ();
+ }
+#endif
+
+ protected internal sealed override void SetSpecialFeatures
(ResultSet res)
+ {
+ // do nothing
+ }
+
+ protected internal sealed override int
JdbcTypeFromProviderType()
+ {
+ return SqlConvert.SqlDbTypeToJdbcType(SqlDbType);
+ }
+
+ #endregion // Methods
+
}
}
Modified:
trunk/mcs/class/System.Data/System.Data.SqlClient.jvm/SqlParameterCollection.cs
===================================================================
---
trunk/mcs/class/System.Data/System.Data.SqlClient.jvm/SqlParameterCollection.cs
2007-05-10 14:46:35 UTC (rev 77136)
+++
trunk/mcs/class/System.Data/System.Data.SqlClient.jvm/SqlParameterCollection.cs
2007-05-10 15:06:42 UTC (rev 77137)
@@ -101,6 +101,11 @@
}
#if NET_2_0
+ public void AddRange (SqlParameter [] values)
+ {
+ base.AddRange (values);
+ }
+
public SqlParameter AddWithValue (string parameterName, object
value)
{
return Add (parameterName, value);
@@ -111,6 +116,11 @@
return base.Contains (value);
}
+ public int IndexOf (SqlParameter value)
+ {
+ return base.IndexOf (value);
+ }
+
public void CopyTo (SqlParameter [] array, int index)
{
base.CopyTo (array, index);
Modified:
trunk/mcs/class/System.Data/System.Data.SqlClient.jvm/SqlTransaction.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlClient.jvm/SqlTransaction.cs
2007-05-10 14:46:35 UTC (rev 77136)
+++ trunk/mcs/class/System.Data/System.Data.SqlClient.jvm/SqlTransaction.cs
2007-05-10 15:06:42 UTC (rev 77137)
@@ -1,6 +1,6 @@
-//
-// System.Data.SqlClient.SqlTransaction
//
+// System.Data.SqlClient.SqlTransaction
+//
// Authors:
// Konstantin Triger <[EMAIL PROTECTED]>
// Boris Kirzner <[EMAIL PROTECTED]>
@@ -60,14 +60,24 @@
{
}
- public new SqlConnection Connection
- {
- get
- {
- return (SqlConnection)_connection;
- }
- }
+ public new SqlConnection Connection
+ {
+ get
+ {
+ return (SqlConnection)_connection;
+ }
+ }
+ [MonoNotSupported("")]
+ public void Save (string savePointName)
+ {
+ throw new NotImplementedException ();
+ }
-
- }}
\ No newline at end of file
+ [MonoNotSupported ("")]
+ public void Rollback (string transactionName)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
\ No newline at end of file
Modified: trunk/mcs/class/System.Data/System.Data.SqlTypes/ChangeLog
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlTypes/ChangeLog 2007-05-10
14:46:35 UTC (rev 77136)
+++ trunk/mcs/class/System.Data/System.Data.SqlTypes/ChangeLog 2007-05-10
15:06:42 UTC (rev 77137)
@@ -1,3 +1,18 @@
+2007-05-10 Adar Wesley <[EMAIL PROTECTED]>
+
+ * SqlBoolean.cs: fixed typo in method names GreaterThanOrEquals,
+ LessThanOrEquals.
+
+ * SqlByte.cs: added missing method Modulus.
+
+ * SqlBytes.cs: added missing methods Read, Write.
+
+ * SqlChars.cs: added missing methods ToSqlString, Write.
+
+ * SqlDateTime.cs: added missing methods Add, Subtract.
+
+ * SqlXml.cs: added missing method CreateReader.
+
2007-05-04 Raja R Harinath <[EMAIL PROTECTED]>
* SqlDateTime.cs: Rewrite parts converting SQL ticks to and from
Modified: trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlBoolean.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlBoolean.cs
2007-05-10 14:46:35 UTC (rev 77136)
+++ trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlBoolean.cs
2007-05-10 15:06:42 UTC (rev 77137)
@@ -179,7 +179,7 @@
return (x > y);
}
- public static SqlBoolean GreaterThanOrEqual (SqlBoolean x,
SqlBoolean y)
+ public static SqlBoolean GreaterThanOrEquals (SqlBoolean x,
SqlBoolean y)
{
return (x >= y);
}
@@ -189,7 +189,7 @@
return (x < y);
}
- public static SqlBoolean LessThanOrEqual (SqlBoolean x,
SqlBoolean y)
+ public static SqlBoolean LessThanOrEquals (SqlBoolean x,
SqlBoolean y)
{
return (x <= y);
}
Modified: trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlByte.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlByte.cs 2007-05-10
14:46:35 UTC (rev 77136)
+++ trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlByte.cs 2007-05-10
15:06:42 UTC (rev 77137)
@@ -176,6 +176,15 @@
return (x % y);
}
+#if NET_2_0
+ // Why did Microsoft add this method in 2.0??? What's
+ // the difference????
+ public static SqlByte Modulus (SqlByte x, SqlByte y)
+ {
+ return (x % y);
+ }
+#endif
+
public static SqlByte Multiply (SqlByte x, SqlByte y)
{
return (x * y);
Modified: trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlBytes.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlBytes.cs
2007-05-10 14:46:35 UTC (rev 77136)
+++ trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlBytes.cs
2007-05-10 15:06:42 UTC (rev 77137)
@@ -232,7 +232,19 @@
{
throw new NotImplementedException ();
}
-
+
+ [MonoNotSupported("")]
+ public long Read (long offset, byte [] buffer, int
offsetInBuffer, int count)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoNotSupported ("")]
+ public void Write (long offset, byte [] buffer, int
offsetInBuffer, int count)
+ {
+ throw new NotImplementedException ();
+ }
+
#endregion
}
}
Modified: trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlChars.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlChars.cs
2007-05-10 14:46:35 UTC (rev 77136)
+++ trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlChars.cs
2007-05-10 15:06:42 UTC (rev 77137)
@@ -169,13 +169,29 @@
buffer = null;
notNull = false;
}
-
+
+ public SqlString ToSqlString ()
+ {
+ if (buffer == null) {
+ return SqlString.Null;
+ }
+ else {
+ return new SqlString (buffer.ToString ());
+ }
+ }
+
[MonoTODO]
public long Read (long offset, char [] buffer, int
offsetInBuffer, int count)
{
throw new NotImplementedException ();
}
+ [MonoNotSupported("")]
+ public void Write (long offset, char [] buffer, int
offsetInBuffer, int count)
+ {
+ throw new NotImplementedException ();
+ }
+
public static XmlQualifiedName GetXsdType (XmlSchemaSet
schemaSet)
{
XmlQualifiedName qualifiedName = new XmlQualifiedName
("string", "http://www.w3.org/2001/XMLSchema");
Modified: trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlDateTime.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlDateTime.cs
2007-05-10 14:46:35 UTC (rev 77136)
+++ trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlDateTime.cs
2007-05-10 15:06:42 UTC (rev 77137)
@@ -235,6 +235,18 @@
return value.GetHashCode ();
}
+#if NET_2_0
+ public static SqlDateTime Add (SqlDateTime x, TimeSpan t)
+ {
+ return (x + t);
+ }
+
+ public static SqlDateTime Subtract (SqlDateTime x, TimeSpan t)
+ {
+ return (x - t);
+ }
+#endif
+
public static SqlBoolean GreaterThan (SqlDateTime x,
SqlDateTime y)
{
return (x > y);
Modified: trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlXml.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlXml.cs 2007-05-10
14:46:35 UTC (rev 77136)
+++ trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlXml.cs 2007-05-10
15:06:42 UTC (rev 77137)
@@ -84,7 +84,13 @@
XmlQualifiedName qualifiedName = new XmlQualifiedName
("anyType", "http://www.w3.org/2001/XMLSchema");
return qualifiedName;
}
-
+
+ [MonoNotSupported("")]
+ public XmlReader CreateReader ()
+ {
+ throw new NotImplementedException ();
+ }
+
[MonoTODO]
XmlSchema IXmlSerializable.GetSchema ()
{
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches