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(); }
No comments:
Post a Comment