[Mono-bugs] [Bug 59948][Nor] Changed - SqlDataAdapter.FillSchema on SQLServer 2000

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 30 Jun 2004 01:16:44 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by sumadevi@novell.com.

http://bugzilla.ximian.com/show_bug.cgi?id=59948

--- shadow/59948	2004-06-23 21:57:59.000000000 -0400
+++ shadow/59948.tmp.10817	2004-06-30 01:16:44.000000000 -0400
@@ -1,13 +1,13 @@
 Bug#: 59948
 Product: Mono: Class Libraries
 Version: unspecified
 OS: All
 OS Details: 
-Status: NEW   
-Resolution: 
+Status: RESOLVED   
+Resolution: FIXED
 Severity: 120 Three weeks
 Priority: Normal
 Component: Sys.Data.SqlClient
 AssignedTo: sumadevi@novell.com                            
 ReportedBy: uballestrazzi@igconsulting.it               
 QAContact: mono-bugs@ximian.com
@@ -23,6 +23,86 @@
 Reading the source code it seems that SqlCommand.ExecuteReader
 (CommandBehaviour) ignores CommandBehaviour parameter (it reads the 
 property not the parameter passed to the function).
 
 Fixing this Mono.Data.Tds retrieves the table name but it's not used 
 (it's just put in the TableNames array)
+
+------- Additional Comments From sumadevi@novell.com  2004-06-30 01:16 -------
+There were 2 problems.
+1. The commandBehavior parameter passed to the SqlCommand.Execute was
+not taken into consideration
+2. The Tds packet handling was not handling TdsPacketSubType.TableName
+
+Test Program used to check is below.
+using System;
+
+using System.Data;
+
+using System.Data.SqlClient;
+
+
+
+namespace MonoTests.System.Data
+
+{
+
+	class SqlDataReaderTest
+
+	{
+
+                public static void Main(string[] args)
+
+                {
+
+					String connectionString = null;
+
+					SqlConnection con;
+
+					SqlCommand cmd;
+
+					SqlDataReader reader;
+
+
+
+					//Fill the conenction string for SQL Server
+
+					    connectionString = "Server=164.99.168.131;" +
+
+                                                "Database=Northwind;" +
+
+                                                "User ID=sa;" +
+						"Password=novell";
+					con = new SqlConnection(connectionString);
+
+					Console.WriteLine ("Opening Connection...");
+					con.Open();
+		new SqlDataReaderTest().test59946(con);
+					con.Close();
+				
+
+                }
+
+
+		private void test59948(SqlConnection con)
+		{
+			string sql = "select * from Region;";
+			SqlCommand c = con.CreateCommand();
+			c.CommandText = sql;
+			SqlDataReader dr =
+c.ExecuteReader(CommandBehavior.KeyInfo|CommandBehavior.SchemaOnly);
+			DataTable schema = dr.GetSchemaTable();
+			
+			foreach (DataColumn col in schema.Columns)
+				Console.Write(col.ColumnName+' ');
+			Console.WriteLine();
+			foreach (DataRow r in schema.Rows)
+			{
+				foreach (DataColumn col in schema.Columns)
+					Console.Write(r[col].ToString()+' ');
+				Console.WriteLine();
+			}	
+		
+		}
+
+
+Fix checked into CVS