[Mono-bugs] [Bug 60320][Nor] Changed - Mono.Data.SybaseClient: SybaseConnection.Open() doesn't work.

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 20 Jun 2004 00:54:39 -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 danielmorgan@verizon.net.

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

--- shadow/60320	2004-06-20 00:44:11.000000000 -0400
+++ shadow/60320.tmp.19488	2004-06-20 00:54:39.000000000 -0400
@@ -102,6 +102,84 @@
 
 
 
      
 
 
+
+------- Additional Comments From danielmorgan@verizon.net  2004-06-20 00:54 -------
+// TestSybaseClient.cs - Test Mono.Data.SybaseClient and 
+Mono.Data.Tds
+
+using System;
+using System.Data;
+using Mono.Data.SybaseClient;
+
+namespace TestSybaseClient 
+{
+	public class TestDriver 
+	{
+		public static void Main(string[] args)
+		{
+			string connectionString = 
+				"Server=MYSERVER,5003;" +
+				"Database=master;" +
+				"User ID=myuserid;" +
+				"Password=mypassword;";
+			IDbConnection dbcon;
+			dbcon = new SybaseConnection
+(connectionString);
+			dbcon.Open();
+			IDbCommand dbcmd = dbcon.CreateCommand();
+			string sql = 
+				"SELECT name " + 
+				"FROM sysobjects";
+			dbcmd.CommandText = sql;
+			IDataReader reader = dbcmd.ExecuteReader();
+			while(reader.Read()) 
+			{
+				string Name = (string) reader
+["name"];
+				Console.WriteLine("Name: " + Name);
+			}
+			// clean up
+			reader.Close();
+			reader = null;
+			dbcmd.Dispose();
+			dbcmd = null;
+			dbcon.Close();
+			dbcon = null;
+		}
+	}
+}
+
+Results:
+D:\cygwin\home\Administrator>e:\mono-beta3\bin\setmonopath.bat
+Mono version Beta3 Build 1
+Prepending 'E:\Mono-Beta3\bin' to PATH
+
+D:\cygwin\home\Administrator>mcs 
+TestSybase.cs /r:System.Data.dll /r:Mono.Data.SybaseClient.dll
+Compilation succeeded
+
+D:\cygwin\home\Administrator>mono TestSybase.exe
+Name: sysalternates
+Name: sysattributes
+Name: syscertificates
+Name: syscharsets
+Name: syscolumns
+Name: syscomments
+Name: sysconfigures
+Name: sysconstraints
+Name: syscurconfigs
+Name: sysdatabases
+Name: sysdepends
+Name: sysdevices
+Name: sysengines
+Name: sysgams
+Name: sysindexes
+Name: sysjars
+Name: syskeys
+Name: syslanguages
+...
+
+