Patrick, To write to a SqlCE database you will need to use the SqlCeConnection connection type. The type to specify will be something like:
System.Data.SqlServerCe.SqlCeConnection, System.Data.Sqlserverce, Version=X.X.X.X, Culture=neutral, PublicKeyToken=XXXXXXXXXXXXXX I don't know what the Version and PublicKeyToken are for the System.Data.Sqlserverce assembly because I don't have it on my system. You should have it on your system (as you are trying to use it) and you should be able to get the version and key from the assembly. I don't think it will be the same as for the System.Data library in the full framework (i.e. not Version=1.0.3300.0). If all else fails you can use something like Lutz Roeder's Reflector for .NET (http://www.aisto.com/roeder/dotnet/) to load the assembly and display the version and key details. Cheers, Nicko > -----Original Message----- > From: Patrick [mailto:[EMAIL PROTECTED] > Sent: 29 November 2004 18:41 > To: Nicko Cadell > Subject: AdoNetAppender > > Dear Mr. Cardell! > > > > Now I have fixed the problem with the connection String and > also some other problems in the config file, but I am not > able to fix the problem with the connection Type. My file > looks as follows: > > > > <?xml version="1.0" encoding="utf-8" ?> > > > > <configuration> > > <configSections> > > <section name="log4net" > type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/> > > </configSections> > > <log4net> > > > > <appender name="ADONetAppender" > type="log4net.Appender.ADONetAppender" > > > <param name="BufferSize" value="100" /> > > <connectionType > value="System.Data.SqlClient.SqlConnection, System.Data, > Version=1.0.3300.0, Culture=neutral, > PublicKeyToken=b77a5c561934e089" /> > > <param name="ConnectionString" value="data > source=achatschitz;initial catalog=HelpDesk;integrated > security=false;persist security info=True;User ID=sa;Password=sa" /> > > <commandText value="INSERT INTO Instrumentation > ([Date],[UserName],[ClassName],[Method],[Description],[Paramet > ers]) VALUES > > (@log_date, @thread, @log_level, @logger, @message, > @exception)" /> > > <parameter> > > <parameterName value="@log_date" /> > > <dbType value="DateTime" /> > > <layout type="log4net.Layout.RawTimeStampLayout"/> > > </parameter> > > <parameter> > > <parameterName value="@thread" /> > > <dbType value="String" /> > > <size value="50" /> > > <layout type="log4net.Layout.PatternLayout"> > > <conversionPattern value="%t" /> > > </layout> > > </parameter> > > <parameter> > > <parameterName value="@log_level" /> > > <dbType value="String" /> > > <size value="50" /> > > <layout type="log4net.Layout.PatternLayout"> > > <conversionPattern value="%p" /> > > </layout> > > </parameter> > > <parameter> > > <parameterName value="@logger" /> > > <dbType value="String" /> > > <size value="50" /> > > <layout type="log4net.Layout.PatternLayout"> > > <conversionPattern value="%c" /> > > </layout> > > </parameter> > > <parameter> > > <parameterName value="@message" /> > > <dbType value="String" /> > > <size value="50" /> > > <layout type="log4net.Layout.PatternLayout"> > > <conversionPattern value="%m" /> > > </layout> > > </parameter> > > <parameter> > > <parameterName value="@exception" /> > > <dbType value="String" /> > > <size value="200" /> > > <layout type="log4net.Layout.ExceptionLayout"/> > > </parameter> > > </appender> > > <root> > > <level value="DEBUG" /> > > <appender-ref ref="ADONetAppender" /> > > </root> > > </log4net> > > > > </configuration> > > > > > > And I get the following error: > > > > Log4net: ERROR [ADONetAppender] Failed to load connection > type [System.Data.SqlClient.SqlConnection, System.Data, > Version 1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089] > > System.TypeLoadException: > System.Data.SqlClient.SqlConnection, System.Data, > Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 > > > > Can you please explain me how I have to write the > connectionType?? (It is for a Smart Device Application, I > also tried to replace the System.Data.SqlClient.SqlConnection > with System.Data.SqlServerCe.SqlCeConnection but still the > same error occurs.) > > > > Please give my some advice. This would be very important for > me if this would work. > > > > > > Best Regards > > > > -------------------------- > > Patrick Achatschitz, Bakk. > > Fasangasse 8/3 > > 1030 Vienna > > Austria > > > > Mobile: 01 650 270 8819 > > > >
