You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
804 B
33 lines
804 B
using System.Data;
|
|
using RS.DBUtility;
|
|
|
|
namespace RS.SQLServerDAL
|
|
{
|
|
public class SDataBaseManage
|
|
{
|
|
/// <summary>
|
|
/// 数据库是否连接
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public bool DBIsConnected()
|
|
{
|
|
bool isConnected = false;
|
|
try
|
|
{
|
|
MySqlHelper sqlHelper = new MySqlHelper();
|
|
sqlHelper.DBConnection();
|
|
//确认是否已打开连接,为打开则打开连接
|
|
if (sqlHelper.SqlConn.State == ConnectionState.Open)
|
|
{
|
|
isConnected = true;
|
|
}
|
|
return isConnected;
|
|
}
|
|
catch
|
|
{
|
|
return isConnected;
|
|
}
|
|
}
|
|
}
|
|
}
|