Through a windows service, I'm trying to insert the sc-bytes and the cs-bytes into a sql server. I'm able to do this via the command prompt windows but when I'm trying to add this in my windows service, it acts dead. I already tested the connection and the LogParser 2.2 commands.
What am I missing / doing wrong?
my code:
System.Diagnostics.Process process = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
startInfo.UseShellExecute = false;
startInfo.FileName = @"cmd.exe";
startInfo.Arguments = @"""C:\Program Files (x86)\Log Parser 2.2\Logparser.exe""" + " \"SELECT date, 4, DIV(DIV(SUM(cs-bytes), 1024), 1024) AS [MBytes received], DIV(DIV(SUM(sc-bytes), 1024), 1024) AS [MBytes sent], COUNT(*) AS Requests INTO tblHostingStatistics FROM <devcom2.be> GROUP BY date ORDER BY date DESC\" -server:mysqlserver -database:database -username:user -password:pass -o:SQL";
process.StartInfo = startInfo;
process.Start();
Any help would be much appreciated