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

TestGDA.cs « System.Data.OleDb « System.Data « class « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 19eea66394949802a53586252f41aff970f5ffd8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System;
using System.Data.OleDb;

namespace Mono.Data.GDA.Test
{
	public class TestGDA
	{
		private IntPtr m_gdaClient = IntPtr.Zero;
		private IntPtr m_gdaConnection = IntPtr.Zero;
		
		static void Main (string[] args)
		{
			TestGDA test = new TestGDA ();
			
			/* initialization */
			libgda.gda_init ("TestGDA#", "0.1", args.Length, args);
			test.m_gdaClient = libgda.gda_client_new ();

			/* open connection */
			test.m_gdaConnection = libgda.gda_client_open_connection (
				test.m_gdaClient,
				"PostgreSQL",
				"", "");
			if (test.m_gdaConnection != IntPtr.Zero) {
				System.Console.Write ("Connection successful!");

				/* close connection */
				libgda.gda_connection_close (test.m_gdaConnection);
			}
		}       
	}
}