Sfoglia il codice sorgente

2002-05-11 Daniel Morgan <[email protected]>

	* System.Data.build: added copy of System.Data.dll to Test directory
	for easy testing.  Also, added clean for it too.

	* System.Data.SqlClient/PostgresLibrary.cs: changed setting of boolean

svn path=/trunk/mcs/; revision=4533
Daniel Morgan 24 anni fa
parent
commit
3ea6c41dd3

+ 7 - 0
mcs/class/System.Data/Test/ChangeLog

@@ -1,3 +1,10 @@
+2002-05-11  Daniel Morgan <[email protected]>
+
+	* Test/PostgresTest.cs: added call to PostgreSQL stored procedure
+	version() which returns the version of the PostgreSQL DBMS you
+	are connected to.  This works and I did not realize it.  Thanks
+	goes to Gonzalo.
+
 2002-05-11  Daniel Morgan <[email protected]>
 
 	* AllTests.cs: needed a using for System.Data and System.Data.SqlClient,

+ 18 - 0
mcs/class/System.Data/Test/PostgresTest.cs

@@ -87,6 +87,19 @@ namespace TestSystemDataSqlClient {
 			dropCommand.ExecuteNonQuery ();
 		}
 
+		static object CallStoredProcedure (IDbConnection cnc) {
+				 
+			IDbCommand callStoredProcCommand = cnc.CreateCommand ();
+			object data;
+
+			callStoredProcCommand.CommandText =
+				"select version()";
+							
+			data = callStoredProcCommand.ExecuteScalar ();
+
+			return data;
+		}
+
 		static void InsertData (IDbConnection cnc) {		
 
 			IDbCommand insertCommand = cnc.CreateCommand();
@@ -318,6 +331,11 @@ namespace TestSystemDataSqlClient {
 				reader.Close();
 				Console.WriteLine ("Rows: " + nRows);		
 
+				// Call a Stored Procedure named Version()
+				Console.WriteLine("\t\tCalling stored procedure version()");
+				object obj = CallStoredProcedure(cnc);
+				Console.WriteLine("Result: " + obj);
+
 				/* Clean up */
 				Console.WriteLine ("Clean up...");
 				Console.WriteLine ("\t\tDrop table...");