2002-08-11 Rodrigo Moya <rodrigo@ximian.com>
[mono.git] / mcs / class / System.Data / System.Data.OleDb / TestOleDb.cs
1 using System;
2 using System.Data.OleDb;
3
4 namespace System.Data.OleDb.Test
5 {
6         public class TestOleDb
7         {
8                 private OleDbConnection m_cnc;
9                 
10                 private TestOleDb ()
11                 {
12                         m_cnc = new OleDbConnection ("PostgreSQL");
13                         m_cnc.Open ();
14                 }
15
16                 void TestDataReader ()
17                 {
18                         string sql = "SELECT * FROM pg_tables";
19                         OleDbCommand cmd = new OleDbCommand (sql, m_cnc);
20
21                         IDataReader reader = cmd.ExecuteReader ();
22                 }
23
24                 void Close ()
25                 {
26                         m_cnc.Close ();
27                 }
28
29                 static void Main (string[] args)
30                 {
31                         try {
32                                 TestOleDb test = new TestOleDb ();
33                                 test.TestDataReader ();
34                                 test.Close ();
35                         } catch (Exception e) {
36                                 Console.WriteLine ("An error has occured: {0}", e.ToString ());
37                         }
38                 }
39         }
40 }