1 // Copyright (c) 1999-2018 David Muse 2 // See the file COPYING for more information. 3 4 using System; 5 using Npgsql; 6 using System.Data; 7 using System.IO; 8 using System.Drawing; 9 using System.Reflection; 10 using System.Runtime.CompilerServices; 11 using System.Runtime.InteropServices; 12 13 namespace NpgsqlClientTest 14 { 15 class NpgsqlAdapterTest 16 { 17 Main(String[] args)18 public static void Main(String[] args) 19 { 20 21 using (var conn=new NpgsqlConnection( 22 "Host=localhost;Username=testuser;" + 23 "Password=testpassword;Database=testdb;" + 24 "Pooling=false")) { 25 conn.Open(); 26 using (var cmd=new NpgsqlCommand()) { 27 cmd.Connection=conn; 28 cmd.CommandText="select $1"; 29 cmd.Parameters.AddWithValue("1","1"); 30 using (var reader=cmd.ExecuteReader()) { 31 while (reader.Read()) { 32 Console.WriteLine( 33 reader.GetString(0)); 34 } 35 } 36 } 37 } 38 39 Environment.Exit(0); 40 } 41 } 42 } 43