2005-01-31 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mcs / class / Mono.Data.Tds / Mono.Data.Tds.Protocol / Tds42.cs
index b7a85ea9523a714ec5d5db7527fdb5501eeff68b..7051dd5fb5f90b17467e8fe11858baee7e6e7cad 100644 (file)
@@ -1,5 +1,5 @@
 //
-// Mono.Data.TdsClient.Internal.Tds42.cs
+// Mono.Data.Tds.Protocol.Tds42.cs
 //
 // Author:
 //   Tim Coleman (tim@timcoleman.com)
@@ -7,10 +7,31 @@
 // Copyright (C) 2002 Tim Coleman
 //
 
+//
+// 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;
 
-namespace Mono.Data.TdsClient.Internal {
-        internal class Tds42 : Tds
+namespace Mono.Data.Tds.Protocol {
+        public class Tds42 : Tds
        {
                #region Fields
 
@@ -191,24 +212,20 @@ namespace Mono.Data.TdsClient.Internal {
 
                        Comm.SendPacket ();
 
-                       TdsPacketResult result;
-                       bool done = false;
+                       MoreResults = true;
+                       SkipToEnd ();
 
-                       while (!done) {
-                               result = ProcessSubPacket ();
-                               done = (result is TdsPacketEndTokenResult);
-                       }
                        return IsConnected;
                }
 
-               protected override TdsPacketColumnInfoResult ProcessColumnInfo ()
+               protected override TdsDataColumnCollection ProcessColumnInfo ()
                {
                        byte precision;
                        byte scale;
                        int totalLength = Comm.GetTdsShort ();
                        int bytesRead = 0;
 
-                       TdsPacketColumnInfoResult result = new TdsPacketColumnInfoResult ();
+                       TdsDataColumnCollection result = new TdsDataColumnCollection ();
 
                        while (bytesRead < totalLength) {
                                scale = 0;
@@ -255,7 +272,7 @@ namespace Mono.Data.TdsClient.Internal {
                                        bytesRead += 1;
                                }
 
-                               int index = result.Add (new TdsSchemaInfo ());
+                               int index = result.Add (new TdsDataColumn ());
                                result[index]["NumericPrecision"] = precision;
                                result[index]["NumericScale"] = scale;
                                result[index]["ColumnSize"] = bufLength;