public static DataTable ExecuteSQLQuery(string strSQL, string dbName, int timeout) { PersistenceBroker broker = PersistenceBroker.Instance(); IDbCommand cmd = broker.GetCommand(dbName); cmd.CommandText = strSQL; if (timeout >= 0) { cmd.CommandTimeout = timeout; } return(broker.ExecuteQuery(cmd, dbName)); }
public DataTable Execute() { StringWriter sql = new StringWriter(); RenderSelect(sql); Assert.VerifyNotNull(sql, Error.NotNull); PersistenceBroker broker = PersistenceBroker.Instance(); IDbCommand cmd = broker.GetCommand(m_ClassMap.Database.Name); cmd.CommandText = sql.ToString(); DataTable dt = broker.ExecuteQuery(cmd, m_ClassMap.Database.Name); return(dt); }
private static IDbCommand StoredProcCommand(string storedProcName, IDataParameter[] param, string dbName) { PersistenceBroker broker = PersistenceBroker.Instance(); IDbCommand cmd = broker.GetCommand(dbName); cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = storedProcName; if (param != null) { for (int intlop = 0; intlop < param.Length; intlop++) { IDataParameter parameter = param[intlop]; cmd.Parameters.Add(parameter); } } return(cmd); }
public static IDataParameter GetParameter(string dbName) { PersistenceBroker broker = PersistenceBroker.Instance(); return(broker.GetCommand(dbName).CreateParameter()); }