两种写法:
if (conn.State == System.Data.ConnectionState.Open)
{
conn.Close();
}
if (conn.State != System.Data.ConnectionState.Closed)
{
conn.Close();
}
大家常用的是哪个?
两种写法:
if (conn.State == System.Data.ConnectionState.Open)
{
conn.Close();
}
if (conn.State != System.Data.ConnectionState.Closed)
{
conn.Close();
}
大家常用的是哪个?
转载于:https://www.cnblogs.com/patrickyu/p/3454668.html