Get data from a column in the database to a variable

2

In a part of my code I have the handling of an exception that uses this message.

 //Grava log com sucesso da importação
fundo.registerLog(Resources.MensagemSucessoImportacao);

The message is inside a Resource file, however it is concatenated.

Arquivo {0} importado com sucesso.

{0} is where my bank table column will be.

My class does not have a variable that takes this column.

Detail: This column comes from a procedure:

 Database db = DatabaseFactory.CreateDatabase();            
 DbCommand cmd = db.GetStoredProcCommand("PR_LOG");

 //Adds other parameters
 db.AddInParameter(cmd, "P_DESCRICAO_LOG", DbType.String, logDescription);

The above structure is in another project class, within a method.

How do I get this column, play on a variable and put this variable after Resources.MensagemSucessoImportacao ?

    
asked by anonymous 04.06.2015 / 21:08

1 answer

1

If I understand you, just use String.Format() :

fundo.registerLog(String.Format(Resources.MensagemSucessoImportacao, logDescription));
    
04.06.2015 / 21:54