两种写法:
if (conn.State == System.Data.ConnectionState.Open)
{
conn.Close();
}
if (conn.State != System.Data.ConnectionState.Closed)
{
conn.Close();
}
大家常用的是哪个?
2023-08-08 16:40:28
两种写法:
if (conn.State == System.Data.ConnectionState.Open)
{
conn.Close();
}
if (conn.State != System.Data.ConnectionState.Closed)
{
conn.Close();
}
大家常用的是哪个?