[Mono-bugs] [Bug 62978][Nor] Changed - Sorry, I reported 4 bugs at once - please split the report

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 9 Dec 2004 14:27:12 -0500 (EST)


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 shurik_u@freemail.ru.

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

--- shadow/62978	2004-12-09 14:07:46.000000000 -0500
+++ shadow/62978.tmp.23922	2004-12-09 14:27:12.000000000 -0500
@@ -204,6 +204,60 @@
       SqlParameter p = new SqlParameter("@P1", DBNull.Value);
       Console.WriteLine("Success!");
       Console.ReadLine();
     }
   }
 }
+
+------- Additional Comments From shurik_u@freemail.ru  2004-12-09 14:27 -------
+//The next two bugs are very similar (the tests are different only 
+//by one line). So I have decided do not split them.
+//It is very very easy to convert one test to another one.
+using System;
+using System.Data;
+using System.Data.SqlClient;
+
+namespace MonoTest
+{
+  /// <summary>
+  /// Summary description for Class1.
+  /// </summary>
+  class SqlParametersValues
+  {
+    /// <summary>
+    /// The main entry point for the application.
+    /// </summary>
+    [STAThread]
+    static void Main(string[] args)
+    {
+      //Table A should exist in database otherwise exclude the Drop 
+statement from execution.
+      string strCreateTable = "Create table [A]  ( [ID] bigint 
+identity (1,1)  not Null, [F1] image default Null)";
+      string strDropTable   = "Drop table [A]";
+      string strInsertRow   = "Insert into [A]([F1]) values(@P1)";
+      
+      SqlCommand cmd = new SqlCommand(strDropTable);
+      cmd.Connection = new SqlConnection("Data Source=ay;Initial 
+Catalog=DataObjectsDotNetDemos;User 
+ID=admin;Password=admin;Enlist=False;");
+      cmd.Connection.Open();
+      cmd.ExecuteNonQuery();      
+      cmd.CommandText = strCreateTable;
+      cmd.ExecuteNonQuery();
+      SqlParameter p = new SqlParameter();
+      p.ParameterName = "@P1";
+      //Zero length arrays as query parameters cause an exception on 
+MONO.
+      p.Value = new byte[0];
+      //DBNull.Value cause as query parameters an exception to (just 
+comment line above and uncomment line below)
+//      p.Value = DBNull.Value;
+      p.DbType = DbType.Binary;
+      cmd.Parameters.Add(p);
+      cmd.CommandText = strInsertRow;
+      cmd.ExecuteNonQuery();
+      Console.WriteLine("Success!");
+      Console.ReadLine();
+    }
+  }
+}