// 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; using System.Data.OleDb; public class MainClass { public static void Main(string[] args) { OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Databases\MSAccess\Test.mdb"); con.Open(); OleDbCommand cmd = new OleDbCommand(); cmd.Connection = con; cmd.CommandText = "Query7"; cmd.CommandType = CommandType.StoredProcedure; OleDbDataReader rdr = cmd.ExecuteReader(); while(rdr.Read()) { int f1 = (int)rdr[1]; string f2 = (string)rdr[2]; Console.WriteLine(f1 + " " + f2); } con.Close(); } }