浏览代码

2005-10-19 Senganal T <[email protected]>

	* Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsConnectionParameter.cs :
		- Added a class variable 'AttachDBFileName' to store the location
		of the DB file.

	* Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds70.cs (Connect) :
		- Modified to append the bytes corresponding to AttachDBFileName 
		into the Tds Packets. 

	* System.Data/System.Data.SqlClient/SqlConnection.cs (SetProperties) :
		- Added support for AttachDBFileName


svn path=/trunk/mcs/; revision=51909
Senganal T 20 年之前
父节点
当前提交
07cfd11085

+ 10 - 0
mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/ChangeLog

@@ -1,3 +1,13 @@
+2005-10-19  Senganal T  <[email protected]>
+
+	* TdsConnectionParameter.cs :
+		- Added a class variable 'AttachDBFileName' to store the location
+		of the DB file.
+
+	* Tds70.cs (Connect) :
+		- Modified to append the bytes corresponding to AttachDBFileName 
+		into the Tds Packets. 
+
 2005-08-26  Sureshkumar T  <[email protected]>
 
 	* Tds70.cs (ExecProc): if no parameters, execute via RPC. parameter

+ 5 - 2
mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds70.cs

@@ -199,7 +199,8 @@ namespace Mono.Data.Tds.Protocol {
 				DataSource.Length +
 				connectionParameters.LibraryName.Length +
 				Language.Length +
-				connectionParameters.Database.Length) * 2); 
+				connectionParameters.Database.Length +
+				connectionParameters.AttachDBFileName.Length) * 2); 
 			
 			if(connectionParameters.DomainLogin == true) {
 				authLen = ((short) (32 + (connectionParameters.Hostname.Length +
@@ -297,7 +298,8 @@ namespace Mono.Data.Tds.Protocol {
 			
 			// Unknown
 			Comm.Append (curPos);
-			Comm.Append ((short) 0);
+			Comm.Append ((short)( connectionParameters.AttachDBFileName.Length));
+			curPos += (short)(connectionParameters.AttachDBFileName.Length*2);
 			
 			// Connection Parameters
 			Comm.Append (connectionParameters.Hostname);
@@ -328,6 +330,7 @@ namespace Mono.Data.Tds.Protocol {
 				Comm.Append (msg.GetBytes ());
 			}
 
+			Comm.Append (connectionParameters.AttachDBFileName);
 			Comm.SendPacket ();
 			MoreResults = true;
 			SkipToEnd ();

+ 2 - 0
mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsConnectionParameters.cs

@@ -45,6 +45,7 @@ namespace Mono.Data.Tds.Protocol {
 		public string User = String.Empty;
 		public bool DomainLogin = false; 
 		public string DefaultDomain = String.Empty; 
+		public string AttachDBFileName = String.Empty; 
 
                 public void Reset ()
                 {
@@ -59,6 +60,7 @@ namespace Mono.Data.Tds.Protocol {
                         User = String.Empty;
                         DomainLogin = false; 
                         DefaultDomain = String.Empty;
+			AttachDBFileName = String.Empty;
                 }
 	}
 }

+ 5 - 0
mcs/class/System.Data/System.Data.SqlClient/ChangeLog

@@ -1,3 +1,8 @@
+2005-10-19  Senganal T  <[email protected]>
+
+	* SqlConnection.cs (SetProperties) :
+		- Added support for AttachDBFileName
+
 2005-10-19  Senganal T  <[email protected]>
 	
 	* SqlException.cs (Constructor)

+ 2 - 1
mcs/class/System.Data/System.Data.SqlClient/SqlConnection.cs

@@ -744,7 +744,8 @@ namespace System.Data.SqlClient {
 			case "ATTACHDBFILENAME" :
 			case "EXTENDED PROPERTIES" :
 			case "INITIAL FILE NAME" :
-				throw new NotImplementedException("Attachable database support is not implemented.");
+				parms.AttachDBFileName = value;
+				break;
 			case "TIMEOUT" :
 			case "CONNECT TIMEOUT" :
 			case "CONNECTION TIMEOUT" :