Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mcs/class
diff options
context:
space:
mode:
authorDaniel Morgan <monodanmorg@yahoo.com>2002-10-12 07:03:00 +0400
committerDaniel Morgan <monodanmorg@yahoo.com>2002-10-12 07:03:00 +0400
commit133b16c231e92ef9f98c256dcc8384cbbeb9c7fb (patch)
treeca7227ecb64a4d0d6eca66a95f45b752b8745ca9 /mcs/class
parentd3cfe3165548db07711d0fbd840b9b70418734e2 (diff)
2002-10-11 Daniel Morgan <danmorg@sc.rr.com>
* OdbcTest.cs: added for System.Data.Odbc tests. Modify this test as needed... svn path=/trunk/mcs/; revision=8197
Diffstat (limited to 'mcs/class')
-rw-r--r--mcs/class/System.Data/Test/ChangeLog6
-rw-r--r--mcs/class/System.Data/Test/OdbcTest.cs60
-rw-r--r--mcs/class/System.Data/Test/System.Data_test.build2
3 files changed, 68 insertions, 0 deletions
diff --git a/mcs/class/System.Data/Test/ChangeLog b/mcs/class/System.Data/Test/ChangeLog
index 5753deef5d4..17587ad3975 100644
--- a/mcs/class/System.Data/Test/ChangeLog
+++ b/mcs/class/System.Data/Test/ChangeLog
@@ -1,3 +1,9 @@
+2002-10-11 Daniel Morgan <danmorg@sc.rr.com>
+
+ * OdbcTest.cs: added
+ for System.Data.Odbc tests. Modify this
+ test as needed...
+
2002-10-10 Ville Palo (vi64pa@koti.soon.fi)
* System.Data.SqlTypes/SqlDoubleTest.cs: new test suite for SqlDouble.
diff --git a/mcs/class/System.Data/Test/OdbcTest.cs b/mcs/class/System.Data/Test/OdbcTest.cs
new file mode 100644
index 00000000000..943ecdf0912
--- /dev/null
+++ b/mcs/class/System.Data/Test/OdbcTest.cs
@@ -0,0 +1,60 @@
+//
+// OdbcTest.cs - Test for the ODBC ADO.NET Provider in System.Data.Odbc
+//
+// The test works on Windows XP using Microsoft .NET Framework 1.1 Beta
+//
+// To compile under Windows using Microsoft .NET 1.1
+// E:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\csc OdbcTest.cs /reference:System.Data.dll
+//
+// To compile under Windows using Mono:
+// mcs OdbcTest.cs -r System.Data.dll
+//
+// I have not tested it on Linux using unixODBC
+//
+// Author:
+// Daniel Morgan <danmorg@sc.rr.com>
+//
+
+using System;
+using System.Data;
+using System.Data.Odbc;
+
+namespace Test.OdbcTest
+{
+ class OdbcTest
+ {
+ [STAThread]
+ static void Main(string[] args)
+ {
+ OdbcConnection dbcon = new OdbcConnection();
+ // connection string to a Microsoft SQL Server 2000 database
+ // that does not use a DSN
+ //dbcon.ConnectionString =
+ // "DRIVER={SQL Server};" +
+ // "SERVER=(local);" +
+ // "Trusted_connection=true;" +
+ // "DATABASE=pubs;";
+
+ // connection string that uses a DSN.
+ dbcon.ConnectionString =
+ "DSN=LocalServer;UID=sa;PWD=";
+
+ dbcon.Open();
+
+ OdbcCommand dbcmd = new OdbcCommand();
+ dbcmd.Connection = dbcon;
+ dbcmd.CommandType = CommandType.Text;
+ dbcmd.CommandText = "SELECT lname FROM employee";
+
+ OdbcDataReader reader;
+ reader = (OdbcDataReader) dbcmd.ExecuteReader();
+
+ while(reader.Read()) {
+ Console.WriteLine("Last Name: " + reader[0].ToString());
+ }
+ reader.Close();
+ dbcmd.Dispose();
+ dbcon.Close();
+ }
+ }
+}
diff --git a/mcs/class/System.Data/Test/System.Data_test.build b/mcs/class/System.Data/Test/System.Data_test.build
index ce77e02c539..586a4557386 100644
--- a/mcs/class/System.Data/Test/System.Data_test.build
+++ b/mcs/class/System.Data/Test/System.Data_test.build
@@ -27,6 +27,7 @@
<excludes name="PostgresTest.cs"/>
<excludes name="TestSqlParameters.cs"/>
<excludes name="SqlSharpCli.cs"/>
+ <excludes name="OdbcTest.cs"/>
</sources>
<references basedir="..\..\..\nunit">
@@ -52,6 +53,7 @@
<excludes name="TestSqlDataAdapter.cs"/>
<excludes name="TestSqlParameters.cs"/>
<excludes name="SqlSharpCli.cs"/>
+ <excludes name="OdbcTest.cs"/>
</sources>
<references basedir="..\..\..\nunit">