Are there any problems with closing and opening of the same SqlConnection object instead of creating new one each time? For example:
SqlConnection conn = new SqlConnection(ConnectionString);
conn.Open();
//Some work here
conn.Close()
//Some work here... conn stays in scope
conn.Open()
Is there any chance to get illegal state exception by opening connection second time?
You can reopen the connection after closing it (you cannot reopen a disposed connection, though).
As for Dave Zych's question - some of our customers have per-connection licences on their databases, closing a connection allows other applications to use it.
Usually you'll have connection pooling enabled, in which case the actual connection to the database will not (always) be closed (immediately) but can be used by other, equal connection objects within your application.