Check if connection state is closed before opening
This commit is contained in:
1 parent
5d4e5d9a1f
commit
7c95b115e4
84 files changed
+291
-291
No files matched your search
@@ -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