views:

94

answers:

1
+1  A: 

Is it a problem if while ConnectionState is doing opening , we Open the connection again?

Yes, it can throw an exception.

Straight from MSDN: SqlConnection.Open method

InvalidOperationException:
Cannot open a connection without specifying a data source or server.
or
The connection is already open

(are you executing the method on different threads with a single shared connection?)

Mehrdad Afshari
@Mehrdad : Yes , There is one connection and it's share between all methods, So all methods open and close it .
Mostafa