SqlConnection conn = new SqlConnection([connectionstring]);
SqlCommand com1 = new SqlCommand("Select * from [tablename]",conn);
conn.Open(); //Open the connection
SqlDataReader reader = com1.ExecuteReader();
while(Reader.Read()){ //read each row at a time
console.write(reader["columname"].toString]);
}
conn.Close(); //don't forget to close it after you're done
Does that help?
The connectionstring is a string which depends on the database location. The stuff in brackets in the sqlcommand is a 'select *' which will return all columns.
When you want to write the stuff out, you either give the column name or an integer. If you don't even know how many columns, you can put a loop which breaks when there's an exception thrown.