what control u want to display data.there are various ways of displaying data using gridview,datagrid,datalist .. so on.
u need to connect to a database first.
u do that using connection string
SqlConnection conn=new sqlconnection("User ID=sa; Initial Catalog=databasename; Data Source=u r datasource");
after connecting,u need to open it
conn.Open();
declare a dataadapter to contain the data u retrieve using select statement
SqlDataAdapter da = new SqlDataAdapter("", conn);
string query = "u r query";
da.SelectCommand = new SqlCommand(query, conn);
da.SelectCommand.ExecuteScalar();
based on the data u can return the tables using icollection,dataset etc