public string AddKeysParametersInvoke() { const string lexFldDb = "<%fldDb>"; string res = string.Empty; string scrap = string.Empty; List <OraclePkColumnDef> tblCols = null; string template = " GE_PAMBCOMMON.ADDPARAMNUMBER(pParams => arrParams, " + Environment.NewLine + " PPARAMNAME => " + MyStringUtils.entreChar(lexFldDb, '\'') + ", " + Environment.NewLine + " PVALUE => P" + lexFldDb + ") "; bool ft = true; try { tblCols = this.oraTblMeta.ObtPkColumnDef(); foreach (var item in tblCols) { scrap = template; scrap = scrap.Replace(lexFldDb, item.ColumnName); res += (ft? string.Empty : Environment.NewLine + "; ") + scrap; ft = false; } return(res); } catch (Exception) { throw; } }
public string AddKeysParametersInvoke() { string res = string.Empty; string sqlStm; string scrap; string template = " GE_PAMBCOMMON.ADDPARAMNUMBER(pParams => arrParams, " + Environment.NewLine + " PPARAMNAME => " + MyStringUtils.entreChar(lexFldDb, '\'') + ", " + Environment.NewLine + " PVALUE => P" + lexFldDb + ") "; bool ft = true; try { sqlStm = sqlKeysTable; sqlStm = sqlStm.Replace(lexTableName, this.TableName); using (DbConnection connection = database.CreateOpenConnection()) { using (DbCommand command = database.CreateCommand(sqlStm, connection)) { using (IDataReader reader = command.ExecuteReader()) { while (reader.Read()) { scrap = template; scrap = scrap.Replace(lexFldDb, Convert.ToString(reader["COLUMN_NAME"])); res += (ft ? string.Empty : Environment.NewLine + "; ") + scrap; ft = false; } } } } return(res); } catch (Exception) { throw; } }