You are not opening the connection,you need to open connection with databases before executing query.
do like this:
SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\v11.0;Integrated Security=True;AttachDbFilename=c:\users\name\documents\visual studio 2013\Projects\DBSample\DBSample\Database1.mdf");
SqlCommand cmd = new SqlCommand("Select * From Account", con);
con.Open();
SqlDataReader rd= cmd.ExecuteReader();
Explanation:
Other examples you read probably use an SqlDataAdapter which opens the connection for you. If you use an SqlCommand directly, however, you need to open the connection yourself.