c#怎么判断数据库是open或close

2024-11-16 05:23:30
推荐回答(2个)
回答1:

con有一个State属性 对应的conn.State == ConnectionState.Open || conn.State == ConnectionState.Broken不懂的属性请看MSDN

回答2:

看con.state