Author: anagappan
Date: 2007-03-30 07:43:28 -0500 (Fri, 30 Mar 2007)
New Revision: 75189
Modified:
trunk/mcs/class/System.Data/System.Data.SqlClient/ChangeLog
trunk/mcs/class/System.Data/System.Data.SqlClient/SqlClientFactory.cs
trunk/mcs/class/System.Data/System.Data.SqlClient/SqlCommand.cs
trunk/mcs/class/System.Data/System.Data.SqlClient/SqlCommandBuilder.cs
trunk/mcs/class/System.Data/System.Data.SqlClient/SqlConnection.cs
trunk/mcs/class/System.Data/System.Data.SqlClient/SqlConnectionStringBuilder.cs
trunk/mcs/class/System.Data/System.Data.SqlClient/SqlDataAdapter.cs
trunk/mcs/class/System.Data/System.Data.SqlClient/SqlDataReader.cs
trunk/mcs/class/System.Data/System.Data.SqlClient/SqlParameter.cs
Log:
2007-03-20 Nidhi Rawal <[EMAIL PROTECTED]>
* SqlClientFactory.cs: Added two using directives.
(CreateConnectionStringBuilder): Implemented the method.
(CreatePermission): Implemented the property.
* SqlCommand.cs: Added one using directive.
(Clone): Implemented the method.
(Dispose): Implemented the method.
(BeginExecuteXmlReader): Implemented the method.
* SqlCommandBuilder.cs (QuoteIdentifier): Implemented the method.
(UnquoteIdentifier): Implemented the method.
* SqlConnection.cs (ChangePassword): Implemented the method.
2007-03-19 Nidhi Rawal <[EMAIL PROTECTED]>
* SqlClientFactory.cs (CanCreateDataSourceEnumerator): Implemented
the property.
* SqlCommand.cs (Notification): Implemented the property.
(NotificationAutoEnlist): Implemented the property.
* SqlDataReader.cs (VisibleFieldCount): Implemented the property.
* SqlConnectionStringBuilder.cs (TrustServerCertificate): Implemented
the property.
(TypeSystemVersion): Implemented the property.
(UserInstance): Implemented the property.
(ContextConnection): Implemented the property.
* SqlConnection.cs (FireInfoMessageEventOnUserErrors): Implemented
the property.
(StatisticsEnabled): Implemented the property.
* SqlDataAdapter.cs (UpdateBatchSize): Implemented the property.
* SqlParameter.cs: Implemented one attribute.
Modified: trunk/mcs/class/System.Data/System.Data.SqlClient/ChangeLog
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlClient/ChangeLog 2007-03-30
12:30:36 UTC (rev 75188)
+++ trunk/mcs/class/System.Data/System.Data.SqlClient/ChangeLog 2007-03-30
12:43:28 UTC (rev 75189)
@@ -1,3 +1,43 @@
+2007-03-20 Nidhi Rawal <[EMAIL PROTECTED]>
+
+ * SqlClientFactory.cs: Added two using directives.
+ (CreateConnectionStringBuilder): Implemented the method.
+ (CreatePermission): Implemented the property.
+
+ * SqlCommand.cs: Added one using directive.
+ (Clone): Implemented the method.
+ (Dispose): Implemented the method.
+ (BeginExecuteXmlReader): Implemented the method.
+
+ * SqlCommandBuilder.cs (QuoteIdentifier): Implemented the method.
+ (UnquoteIdentifier): Implemented the method.
+
+ * SqlConnection.cs (ChangePassword): Implemented the method.
+
+2007-03-19 Nidhi Rawal <[EMAIL PROTECTED]>
+
+ * SqlClientFactory.cs (CanCreateDataSourceEnumerator): Implemented
+ the property.
+
+ * SqlCommand.cs (Notification): Implemented the property.
+ (NotificationAutoEnlist): Implemented the property.
+
+ * SqlDataReader.cs (VisibleFieldCount): Implemented the property.
+
+ * SqlConnectionStringBuilder.cs (TrustServerCertificate): Implemented
+ the property.
+ (TypeSystemVersion): Implemented the property.
+ (UserInstance): Implemented the property.
+ (ContextConnection): Implemented the property.
+
+ * SqlConnection.cs (FireInfoMessageEventOnUserErrors): Implemented
+ the property.
+ (StatisticsEnabled): Implemented the property.
+
+ * SqlDataAdapter.cs (UpdateBatchSize): Implemented the property.
+
+ * SqlParameter.cs: Implemented one attribute.
+
2007-03-16 Andreia Gaita <[EMAIL PROTECTED]>
* SqlParameter.cs: Move isVariableSizeType flag to TdsMetaParameter
@@ -41,6 +81,8 @@
* SqlParameter.cs (CompareInfo): Implemented the property
CompareInfo.
+ (LocaleId): Written the property LocaleId.
+ (SqlValue): Written the propert SqlValue.
2007-02-15 Nidhi Rawal <[EMAIL PROTECTED]>
Modified: trunk/mcs/class/System.Data/System.Data.SqlClient/SqlClientFactory.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlClient/SqlClientFactory.cs
2007-03-30 12:30:36 UTC (rev 75188)
+++ trunk/mcs/class/System.Data/System.Data.SqlClient/SqlClientFactory.cs
2007-03-30 12:43:28 UTC (rev 75189)
@@ -32,6 +32,8 @@
{
using System.Data;
using System.Data.Common;
+ using System.Security;
+ using System.Security.Permissions;
public sealed class SqlClientFactory : DbProviderFactory
{
@@ -47,10 +49,11 @@
}
#endregion //Constructors
- [MonoTODO]
+ #region Properties
public override bool CanCreateDataSourceEnumerator {
- get { throw new NotImplementedException ();}
+ get { return true; }
}
+ #endregion //Properties
#region public overrides
public override DbCommand CreateCommand ()
@@ -67,6 +70,11 @@
{
return (DbConnection) new SqlConnection ();
}
+
+ public override DbConnectionStringBuilder
CreateConnectionStringBuilder ()
+ {
+ return (DbConnectionStringBuilder) new
SqlConnectionStringBuilder ();
+ }
public override DbDataAdapter CreateDataAdapter ()
{
@@ -82,7 +90,11 @@
{
return (DbParameter) new SqlParameter ();
}
-
+
+ public override CodeAccessPermission CreatePermission
(PermissionState state)
+ {
+ return (CodeAccessPermission) new
SqlClientPermission(state);
+ }
#endregion // public overrides
}
}
Modified: trunk/mcs/class/System.Data/System.Data.SqlClient/SqlCommand.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlClient/SqlCommand.cs
2007-03-30 12:30:36 UTC (rev 75188)
+++ trunk/mcs/class/System.Data/System.Data.SqlClient/SqlCommand.cs
2007-03-30 12:43:28 UTC (rev 75189)
@@ -43,6 +43,9 @@
using System.ComponentModel;
using System.Data;
using System.Data.Common;
+#if NET_2_0
+using System.Data.Sql;
+#endif
using System.Runtime.InteropServices;
using System.Text;
using System.Xml;
@@ -59,7 +62,7 @@
{
#region Fields
- //bool disposed = false;
+ bool disposed = false;
int commandTimeout;
bool designTimeVisible;
string commandText;
@@ -70,6 +73,10 @@
CommandBehavior behavior = CommandBehavior.Default;
SqlParameterCollection parameters;
string preparedStatement = null;
+#if NET_2_0
+ SqlNotificationRequest notification;
+#endif
+ bool notificationAutoEnlist;
#endregion // Fields
@@ -100,6 +107,7 @@
this.designTimeVisible = false;
this.commandTimeout = 30;
+ notificationAutoEnlist = true;
parameters = new SqlParameterCollection (this);
}
@@ -298,6 +306,18 @@
}
}
+#if NET_2_0
+ public SqlNotificationRequest Notification {
+ get { return notification; }
+ set { notification = value; }
+ }
+
+ [DefaultValue (true)]
+ public bool NotificationAutoEnlist {
+ get { return notificationAutoEnlist; }
+ set { notificationAutoEnlist = value; }
+ }
+#endif
#endregion // Fields
#region Methods
@@ -313,6 +333,13 @@
Connection.Tds.Cancel ();
}
+#if NET_2_0
+ public SqlCommand Clone ()
+ {
+ return new SqlCommand (commandText, connection,
transaction, commandType, updatedRowSource, designTimeVisible, commandTimeout,
parameters);
+ }
+#endif // NET_2_0
+
internal void CloseDataReader (bool moreResults)
{
Connection.DataReader = null;
@@ -549,6 +576,21 @@
return ExecuteReader (behavior);
}
+ protected override void Dispose (bool disposing)
+ {
+ if (!disposed) {
+ if (disposing) {
+ base.Dispose (disposing);
+ if (connection != null)
+ connection.Dispose ();
+ if (transaction != null)
+ transaction.Dispose ();
+ parameters.Clear ();
+ }
+ disposed = true;
+ }
+ }
+
public
#if NET_2_0
override
@@ -801,6 +843,12 @@
ar.BubbleCallback, state);
return ar;
}
+
+ public IAsyncResult BeginExecuteXmlReader ()
+ {
+ return BeginExecuteXmlReader (null, null);
+ }
+
public XmlReader EndExecuteXmlReader (IAsyncResult ar)
{
Modified: trunk/mcs/class/System.Data/System.Data.SqlClient/SqlCommandBuilder.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlClient/SqlCommandBuilder.cs
2007-03-30 12:30:36 UTC (rev 75188)
+++ trunk/mcs/class/System.Data/System.Data.SqlClient/SqlCommandBuilder.cs
2007-03-30 12:43:28 UTC (rev 75189)
@@ -575,6 +575,17 @@
return CreateInsertCommand (option);
return insertCommand;
}
+
+ public override string QuoteIdentifier (string
unquotedIdentifier)
+ {
+ return base.QuoteIdentifier (unquotedIdentifier);
+ }
+
+ public override string UnquoteIdentifier (string
quotedIdentifier)
+ {
+ return base.UnquoteIdentifier (quotedIdentifier);
+ }
+
#endif // NET_2_0
private bool IncludedInInsert (DataRow schemaRow)
Modified: trunk/mcs/class/System.Data/System.Data.SqlClient/SqlConnection.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlClient/SqlConnection.cs
2007-03-30 12:30:36 UTC (rev 75188)
+++ trunk/mcs/class/System.Data/System.Data.SqlClient/SqlConnection.cs
2007-03-30 12:43:28 UTC (rev 75189)
@@ -77,7 +77,7 @@
// Connection parameters
- TdsConnectionParameters parms = new TdsConnectionParameters ();
+ internal TdsConnectionParameters parms = new
TdsConnectionParameters ();
NameValueCollection connStringParameters = null;
bool connectionReset;
bool pooling;
@@ -87,6 +87,8 @@
int maxPoolSize;
int packetSize;
int port = 1433;
+ bool fireInfoMessageEventOnUserErrors;
+ bool statisticsEnabled;
// The current state
ConnectionState state = ConnectionState.Closed;
@@ -258,6 +260,17 @@
set { xmlReader = value; }
}
+#if NET_2_0
+ public bool FireInfoMessageEventOnUserErrors {
+ get { return fireInfoMessageEventOnUserErrors; }
+ set { fireInfoMessageEventOnUserErrors = value; }
+ }
+
+ public bool StatisticsEnabled {
+ get { return statisticsEnabled; }
+ set { statisticsEnabled = value; }
+ }
+#endif
#endregion // Properties
#region Events
@@ -1521,7 +1534,7 @@
"as public_key,
is_fixed_length, max_length, Create_Date, " +
"Permission_set_desc
from sys.assemblies as assemblies join " +
"sys.assembly_types
as types on assemblies.assembly_id = types.assembly_id" +
- " where
(assemblies.name = @AssemblyName or (@AssemblyName is null)) and " +
+ " where
(assportemblies.name = @AssemblyName or (@AssemblyName is null)) and " +
"(types.assembly_class = @UDTName or (@UDTName is null))",
this);
command.Parameters.Add ("@AssemblyName",
SqlDbType.NVarChar, 4000);
@@ -1545,6 +1558,21 @@
dataAdapter.Fill (dataTable);
return dataTable;
}
+
+ public static void ChangePassword (string connectionString,
string newPassword)
+ {
+ 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");
+ SqlConnection conn = new SqlConnection
(connectionString);
+ using (conn) {
+ conn.Open ();
+ conn.tds.Execute (String.Format ("sp_password
'{0}', '{1}', '{2}'",
+
conn.parms.Password, newPassword, conn.parms.User));
+ conn.Close ();
+ }
+ }
#endif // NET_2_0
#endregion // Methods
Modified:
trunk/mcs/class/System.Data/System.Data.SqlClient/SqlConnectionStringBuilder.cs
===================================================================
---
trunk/mcs/class/System.Data/System.Data.SqlClient/SqlConnectionStringBuilder.cs
2007-03-30 12:30:36 UTC (rev 75188)
+++
trunk/mcs/class/System.Data/System.Data.SqlClient/SqlConnectionStringBuilder.cs
2007-03-30 12:43:28 UTC (rev 75189)
@@ -67,6 +67,10 @@
private const bool DEF_REPLICATION = false;
private const string DEF_USERID = "";
private const string DEF_WORKSTATIONID = "";
+ private const string DEF_TYPESYSTEMVERSION =
"Latest";
+ private const bool DEF_TRUSTSERVERCERTIFICATE = false;
+ private const bool DEF_USERINSTANCE =
false;
+ private const bool DEF_CONTEXTCONNECTION =
false;
#region // Fields
@@ -94,6 +98,10 @@
private bool _replication;
private string _userID;
private string _workstationID;
+ private bool _trustServerCertificate;
+ private string _typeSystemVersion;
+ private bool _userInstance;
+ private bool _contextConnection;
private static Dictionary <string, string> _keywords; // for
mapping duplicate keywords
#endregion // Fields
@@ -152,8 +160,9 @@
_keywords ["USER"] = "User Id";
_keywords ["USER ID"] = "User Id";
_keywords ["WSID"] = "Workstation
Id";
- _keywords ["WORKSTATION ID"] = "Workstation
Id";
-
+ _keywords ["WORKSTATION ID"] = "Workstation
Id";
+ _keywords ["USER INSTANCE"] = "User
Instance";
+ _keywords ["CONTEXT CONNECTION"] = "Context
Connection";
}
#endregion // Constructors
@@ -418,6 +427,38 @@
_workstationID = value;
}
}
+
+ public bool TrustServerCertificate {
+ get { return _trustServerCertificate; }
+ set {
+ base ["Trust Server Certificate"] = value;
+ _trustServerCertificate = value;
+ }
+ }
+
+ public string TypeSystemVersion {
+ get { return _typeSystemVersion; }
+ set {
+ base ["Type System Version"] = value;
+ _typeSystemVersion = value;
+ }
+ }
+
+ public bool UserInstance {
+ get { return _userInstance; }
+ set {
+ base ["User Instance"] = value;
+ _userInstance = value;
+ }
+ }
+
+ public bool ContextConnection {
+ get { return _contextConnection; }
+ set {
+ base ["Context Connection"] = value;
+ _contextConnection = value;
+ }
+ }
#endregion // Properties
#region Methods
@@ -447,6 +488,10 @@
_replication = DEF_REPLICATION;
_userID = DEF_USERID;
_workstationID = DEF_WORKSTATIONID;
+ _trustServerCertificate = DEF_TRUSTSERVERCERTIFICATE;
+ _typeSystemVersion = DEF_TYPESYSTEMVERSION;
+ _userInstance = DEF_USERINSTANCE;
+ _contextConnection = DEF_CONTEXTCONNECTION;
}
public override void Clear ()
@@ -543,6 +588,13 @@
} else
this.CurrentLanguage = value.ToString
();
break;
+ case "CONTEXT CONNECTION" :
+ if (value == null) {
+ _contextConnection =
DEF_CONTEXTCONNECTION;
+ base.Remove (mappedKey);
+ } else
+ this.ContextConnection =
DbConnectionStringBuilderHelper.ConvertToBoolean (value);
+ break;
case "DATA SOURCE" :
if (value == null) {
_dataSource = DEF_DATASOURCE;
@@ -656,6 +708,13 @@
} else
this.UserID = value.ToString ();
break;
+ case "USER INSTANCE" :
+ if (value == null) {
+ _userInstance = DEF_USERINSTANCE;
+ base.Remove (mappedKey);
+ } else
+ this.UserInstance =
DbConnectionStringBuilderHelper.ConvertToBoolean (value);
+ break;
case "WORKSTATION ID" :
if (value == null) {
_workstationID = DEF_WORKSTATIONID;
Modified: trunk/mcs/class/System.Data/System.Data.SqlClient/SqlDataAdapter.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlClient/SqlDataAdapter.cs
2007-03-30 12:30:36 UTC (rev 75188)
+++ trunk/mcs/class/System.Data/System.Data.SqlClient/SqlDataAdapter.cs
2007-03-30 12:43:28 UTC (rev 75189)
@@ -51,7 +51,9 @@
SqlCommand insertCommand;
SqlCommand selectCommand;
SqlCommand updateCommand;
-
+#if NET_2_0
+ int updateBatchSize;
+#endif
#endregion
#region Constructors
@@ -67,6 +69,9 @@
InsertCommand = null;
SelectCommand = selectCommand;
UpdateCommand = null;
+#if NET_2_0
+ UpdateBatchSize = 1;
+#endif
}
public SqlDataAdapter (string selectCommandText, SqlConnection
selectConnection)
@@ -168,6 +173,18 @@
get { return TableMappings; }
}
+#if NET_2_0
+ [DefaultValue (1)]
+ public override int UpdateBatchSize {
+ get { return updateBatchSize; }
+ set {
+ if (value < 0)
+ throw new ArgumentOutOfRangeException
();
+ updateBatchSize = value;
+ }
+ }
+#endif
+
#endregion // Properties
#region Methods
Modified: trunk/mcs/class/System.Data/System.Data.SqlClient/SqlDataReader.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlClient/SqlDataReader.cs
2007-03-30 12:30:36 UTC (rev 75188)
+++ trunk/mcs/class/System.Data/System.Data.SqlClient/SqlDataReader.cs
2007-03-30 12:43:28 UTC (rev 75189)
@@ -65,6 +65,9 @@
bool haveRead;
bool readResult;
bool readResultUsed;
+#if NET_2_0
+ int visibleFieldCount;
+#endif
#endregion // Fields
@@ -81,6 +84,9 @@
fieldCount = 0;
isClosed = false;
command.Tds.RecordsAffected = -1;
+#if NET_2_0
+ visibleFieldCount = 0;
+#endif
NextResult ();
}
@@ -152,6 +158,11 @@
return readResult;
}
}
+#if NET_2_0
+ public override int VisibleFieldCount {
+ get { return visibleFieldCount; }
+ }
+#endif
#endregion // Properties
@@ -738,6 +749,10 @@
row ["IsLong"] = false;
break;
}
+#if NET_2_0
+ if ((bool)row ["IsHidden"] == false)
+ visibleFieldCount += 1;
+#endif
schemaTable.Rows.Add (row);
Modified: trunk/mcs/class/System.Data/System.Data.SqlClient/SqlParameter.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlClient/SqlParameter.cs
2007-03-30 12:30:36 UTC (rev 75188)
+++ trunk/mcs/class/System.Data/System.Data.SqlClient/SqlParameter.cs
2007-03-30 12:43:28 UTC (rev 75189)
@@ -67,6 +67,9 @@
string sourceColumn;
DataRowVersion sourceVersion;
SqlCompareOptions compareInfo;
+ int localId;
+ Object sqlValue;
+ string udtTypeName;
#endregion // Fields
@@ -380,15 +383,22 @@
}
#if NET_2_0
- public SqlCompareOptions CompareInfo {
+ [Browsable (false)]
+ public SqlCompareOptions CompareInfo{
get{ return compareInfo; }
- set{
- compareInfo = value;
- }
+ set{ compareInfo = value; }
}
-#endif
-#if NET_2_0
+ public int LocaleId {
+ get { return localId; }
+ set { localId = value; }
+ }
+
+ public Object SqlValue {
+ get { return sqlValue; }
+ set { sqlValue = value; }
+ }
+
public override bool SourceColumnNullMapping {
get { return false ; }
set { }
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches