title: Log4net Custom ADO Appender (no config): Data is not going into database
body: <p>Using log4net (C#) and Oracle, I'm trying to create a custom ADO Appender so that I don't need to use a config file. My code so far</p>
  
  <pre><code>public static void CreateAppender()
  {
      var hierarchy = (Hierarchy)LogManager.GetRepository();
      hierarchy.Root.RemoveAllAppenders();
  
      var ADOAppender = new AdoNetAppender();
     AddDateTimeParameterToAppender(ADOAppender, ":log_date", "log4net.Layout.RawTimeStampLayout");
     AddStringParameterToAppender(ADOAppender, ":thread", 255, "%thread");
     AddStringParameterToAppender(ADOAppender, ":log_level", 50, "%level");
     AddStringParameterToAppender(ADOAppender, ":logger", 255, "%logger");
     AddStringParameterToAppender(ADOAppender, ":message", 30000, "%message");
  
     ADOAppender.ConnectionType =
              "System.Data.OracleClient.OracleConnection, System.Data.OracleClient, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
  
     ADOAppender.CommandText =
              "INSERT INTO Log (Datetime,Thread,Log_Level,Logger,Message) VALUES (:log_date, :thread, :log_level, :logger, :message)";
  
     ADOAppender.ConnectionString = "data source=[db];User ID=[id];Password=[pass]";
  
     ADOAppender.BufferSize = 1;
  
    ADOAppender.ActivateOptions();
  
    log4net.Config.BasicConfigurator.Configure(ADOAppender);
  }
  
  public static void AddDateTimeParameterToAppender(AdoNetAppender appender, string paramName, string conversionPattern)
  {
         var param = new AdoNetAppenderParameter { ParameterName = paramName, DbType = System.Data.DbType.DateTime, Layout = new Layout2RawLayoutAdapter(new PatternLayout(conversionPattern)) };
     appender.AddParameter(param);
  }
  
  public static void AddStringParameterToAppender(AdoNetAppender appender, string paramName, int size, string conversionPattern)
  {
     var param = new AdoNetAppenderParameter
     {
        ParameterName = paramName,
        DbType = System.Data.DbType.String,
        Size = size,          
        Layout = new Layout2RawLayoutAdapter(new PatternLayout(conversionPattern))
     };
  appender.AddParameter(param);
  
  }
  </code></pre>
  
  <p>I'm not getting any exceptions, yet no data is being inserted into the database. I'm almost positive it has to do with the parameters because when I set all of the values to null, it works. </p>
  
  <p>Does anyone see what I'm doing wrong? I've googled A LOT but none of the examples I found used the ADO Appender. Thanks</p>