h1.post-title { color:orange; font-family:verdana,Arial; font-weight:bold; padding-bottom:5px; text-shadow:#64665b 0px 1px 1px; font-size:32px; } -->

Pages

Invalid attempt to call Read when reader is closed

Why?:Invalid attempt to call Read when reader is closed
if (reader.HasRows) { while (reader.Read()) { Id = reader["Id"].ToString(); Con.Close(); } }
Solution:
if (reader.HasRows) { while (reader.Read()) { Id = reader["Id"].ToString(); } Con.Close(); }