// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Data.Odbc; public class MainClass { public static void Main(string[] args) { OdbcConnection con = new OdbcConnection("Dsn=TestTimesTen;"); con.Open(); OdbcCommand cmd = new OdbcCommand("SELECT * FROM t1", con); OdbcDataReader rdr = cmd.ExecuteReader(); while(rdr.Read()) { int f1 = (int)rdr[0]; string f2 = (string)rdr[1]; Console.WriteLine(f1 + " " + f2); } con.Close(); Console.ReadLine(); } }