/// <summary> /// 执行一个SQL语句命令并返回受影响的行数 /// </summary> /// <param name="strSql">SQL语句</param> /// <returns>SQL语句执行后受影响的行数</returns> public static int ExecuteNonQuery(string strSql) { DbCore dbCore = null; try { dbCore = new DbCore(GetDatabaseType(), GetConnectionString()); dbCore.Open(); return(dbCore.ExecuteNonQuery(strSql)); } catch (Exception ex) { throw ex; } finally { if (dbCore != null) { dbCore.Close(); } } }