0

I am having a bit of an issue with logging information from my console application in Visual Studio to an SQL database. The issue is, I have no idea where to start.

I currently have a separate log file that logs specific information. I want to take this information and make an SQL database to use on my website. I know I could manually enter the logs into the database but I want it to log automatically as the information needs to be displayed and updated at least once an hour.

As I said, I have no clue where to start on this.

Cœur
  • 37,241
  • 25
  • 195
  • 267
  • Do you want to capture the standard out? or can you just create a method that inserts to a table when you have a log event? – crthompson May 01 '14 at 15:09
  • I have googled it. I am using VS 2013. The link you gave me was from the year 2000. Things in VS have since changed. Most tuts out there are for 2010 and 2012 and are quite different than 2013. Ill put it in more direct terms. I have an automated trading bot on steam. When there is a successful trade I have it set to log each successful trade, who it was, what time it was, and what item they bought. I want those stats to be logged to an SQL that I will later call on my website to display said stats. – user3593129 May 01 '14 at 15:14
  • Have you decided upon a type of database? I think you would need a simple table with columns: ID, SteamID(or username), ItemID (or itemName), PurchaseTime. Your current code would then need to pass these values to a method which inserts these values into a database table for your website to call. This should get you started in the direction you want to go... – PeonProgrammer May 01 '14 at 15:27

1 Answers1

0

You could always use log4net to log directly to your database with a AdoNetAppender or if you need to import the existing log files into a database an ETL tool like SSIS (this SO post explains this quite well) will cope with this quite well

Community
  • 1
  • 1
jaywayco
  • 5,846
  • 6
  • 25
  • 40