Ejemplo n.º 1
0
        private static void testDbConnection(DBAccess _instance)
        {
            DataBaseAccess dba = _instance.CreateInstance();

            try
            {
                dba.ExecuteScalar("SELECT 1");
            }
            catch (Exception exc)
            {
                throw new Exception("[" + dba.DbType.ToString() + "]数据库连接失败,请检查连接信息是否有正确!");
            }
        }
Ejemplo n.º 2
0
 private static void testDbConnection(DBAccess _instance)
 {
     DataBaseAccess dba = _instance.CreateInstance();
     try
     {
         dba.ExecuteScalar("SELECT 1");
     }
     catch (Exception exc)
     {
         throw new Exception("[" + dba.DbType.ToString() + "]数据库连接失败,请检查连接信息是否有正确!");
     }
 }