using System; using System.Data.SqlClient; class Baasiproov1a{ public static void Main(string[] arg){ string constr="Data Source=RINDE\\SQLEXPRESS;"+ "Initial Catalog=proovibaas; "+ "Integrated Security=SSPI; Persist Security Info=False"; string lause="SELECT eesnimi FROM inimesed"; SqlConnection cn=new SqlConnection(constr); cn.Open(); SqlCommand cm = new SqlCommand(lause, cn); SqlDataReader reader=cm.ExecuteReader(); while(reader.Read()){ Console.WriteLine(reader.GetString(reader.GetOrdinal("eesnimi"))); } cn.Close(); } }