Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 4th, 2012  |  syntax: None  |  size: 0.64 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. c# - What's the best way to keep log for events of windows form application?
  2. private AddUser(User id)
  3.     {
  4.         if(id != null)
  5.         {
  6.             MessageBox.Show("Item Updated");
  7.             string sqlAddUser = "INSERT INTO 'DATABASE.USER' VALUES (Item.ID, Item.Name, Item.Address)";
  8.             if(db.SqlNonQuery(sqlAddUser) //If successful
  9.             {
  10.                 ///To DO : Add system log into database
  11.                 ///Ex. string sqlLog = DateTime.Now + User.ID + " added Item ID " + item.ID;
  12.             }
  13.             else
  14.             {
  15.                 MessageBox.Show("Error");            
  16.             }    
  17.         }
  18.     }