How do I configure NLog to write to a database?

前端 未结 4 1309
走了就别回头了
走了就别回头了 2020-12-24 12:21

I\'m trying to get NLog to write to a database, however with my current code it throws an exception when I attempt to debug, the exception is: The type initializer for \'Not

4条回答
  •  盖世英雄少女心
    2020-12-24 13:15

    It looks your insert string is not in the right format? You are missing () around the parameters list.

    commandText="INSERT INTO Logs (Machine_Name, Username, Logon_Time, Screensaver_On, Screensaver_Off, Logoff_Time, Program_Start) Values (@MachineName, @Username, @LogonTime, @Screensaver_On, @Screensaver_Off, @LogoffTime, @ProgramStart) "
    

提交回复
热议问题