All pastes #730012 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-10-08 20:07 UTC
rendered paste body
// /home/jagger/Projects/test1/test1/Main.cs created with MonoDevelop
// User: jagger at 6:40 PM 10/8/2007
//
// To change standard headers go to Edit->Preferences->Coding->Standard Headers
//
// project created on 10/8/2007 at 6:40 PM
using System;
using Gtk;
using System.Data;
using Mono.Data.SqliteClient;

namespace test1
{
	public class MainClass
	{
		public static void Main (string[] args)
		{

			string connectionString = "URI=file:/home/jagger/mail.db,version=3";
			IDbConnection dbcon;
			dbcon = (IDbConnection) new SqliteConnection(connectionString);
			dbcon.Open();
			IDbCommand dbcmd = dbcon.CreateCommand();
			string sql = "SELECT domain, SUM (bytes_sent) AS bytes_sent_total, SUM (bytes_recv) AS bytes_recv_total, SUM (msgs_sent) AS msgs_sent_total, SUM (msgs_recv) AS msgs_recv_total, SUM (msgs_popped) AS msgs_popped_total,  SUM (bytes_popped) AS bytes_popped_total FROM traffic GROUP BY domain";
			dbcmd.CommandText = sql;
			IDataReader reader = dbcmd.ExecuteReader();
			

			
			reader.Close();
			reader = null;
			dbcmd.Dispose();
			dbcmd = null;
			dbcon.Close();
			dbcon = null;
			
			
			
			Application.Init ();
			MainWindow win = new MainWindow ();

			win.Title = "FUCK";
				
/*
			while (reader.Read ()) {
			
				string mystring = reader.GetString(0) + "," + reader.GetString(1) + "," + reader.GetString(2) + "," + reader.GetString(3) + "," + reader.GetString(4) + "," + reader.GetString(5) + "," + reader.GetString(6);
			
			win.Title = mystring;
			
			}
*/
			win.Show ();
			Application.Run ();
		}
	}
}