Check if connection state is closed before opening
This commit is contained in:
@@ -50,7 +50,7 @@ namespace RODBInterface
|
||||
SqlConnection cn = new SqlConnection(SqlConnectionStr);
|
||||
try
|
||||
{
|
||||
cn.Open();
|
||||
if (cn.State == System.Data.ConnectionState.Closed) cn.Open();
|
||||
if (OnlyConnectOnce && ROAPP_SqlConnectionOnce == null) ROAPP_SqlConnectionOnce = cn;
|
||||
return cn;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user