Check the rest of your code: somewhere you have left it open.
I would suggest two things:
1) Don't rely on a single "global" SqlConnection object: create them anew when you need them, and Dispose of them when you are done - a
using
block is a very good idea:
using (SqlConnection con = new SqlConnection(strConnect))
{
con.Open();
...
}
That way the system will handle Close and Dispose for you. You should also use
using
blocks with SqlCommand and other objects as well.
2) A try...catch...finally block is also a good idea!