|
Hi I posted this previously in an earlier thread but haven’t
received a reply yet so thought I would try it on it’s own thread… I've been using properties to send several user-defined
messages via the ADO.NET appender. This works great except when I'm trying to
set a parameter value to DBNull.Value (to set the column value that this
parameter relates to to null), e.g. using the command
"log4net.GlobalContext.Properties["Message2"] =
DBNull.Value;". In this case the column in the table is being set to an
empty string rather than NULL. This seems to be during the call to
AdoNetAppender.SendBuffer when the actual ado.net parameters value is being
set. The config for this parameter is: <parameter> <parameterName
value="@message2" /> <dbType
value="string" /> <size
value="100"/> <layout
type="log4net.Layout.PatternLayout">
<conversionPattern value="%property{Message2}" /> </layout> </parameter> Is it possible to get it to send DBNull.Value instead so the
column value will be set to null? Thanks Ant Scanned for viruses by BlackSpider MailControl. The integrity and security of this message cannot be guaranteed. This email is intended for the named recipient only, and may contain confidential information and proprietary material. Any unauthorised use or disclosure is prohibited. |
- Setting AdoNetAppender parameters to null Coates, Anthony
- RE: Setting AdoNetAppender parameters to null Nicko Cadell
- RE: Setting AdoNetAppender parameters to null Coates, Anthony
