Error Loging

  • Thread starter Thread starter Mystique
  • Start date Start date
M

Mystique

Hi
Does anybody know i can log the parameters that are called to a Oracle
stored procedure with C#?
I am using ODP Data Provider for the connection.

Regards,
Mystique
 
The easiest way may be to loop throught the command parameters
collection and manually build a string. For example:

StringBuilder sbQuery = new StringBuilder();
sbQuery.Append("Parameters ");
foreach (DbParameter param in command.Parameters)
{
sbQuery.Append("[");
sbQuery.Append(param.ParameterName);
sbQuery.Append("=");
if (param.Value != null)
{
sbQuery.Append(param.Value.ToString());
}
sbQuery.Append("]");
}

// Log(sbQuery.ToString());


Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top