All pastes #954433 Raw Edit

Stuff

public text v1 · immutable
#954433 ·published 2008-03-23 22:06 UTC
rendered paste body
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Collections;
using System.Data.OleDb;

namespace Diathematiki
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            WindowState = FormWindowState.Maximized;
            ChartModeComboBox.SelectedIndex = 0;
        }

        public string connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Data.mdb";

        TotalInfo ti;
        public ArrayList Info;
        public ArrayList SelectedListViewItems;
        public Object[,] nullObjectArray = new Object[2, 1] { { null },
                                                { null }};

        private void Form1_Load(object sender, EventArgs e)
        {
            nullChart();
            if(ResultsListView.Items.Count > 0)
                ResultsListView.Items.Clear();
            string strSelect = @"SELECT saveddata.date, saveddata.totaltime FROM saveddata";

            try
            {
                DataSet myDataSet = new DataSet();
                OleDbConnection oledbConn = new OleDbConnection(connStr);
                OleDbDataAdapter oledbAdapter = new OleDbDataAdapter(strSelect, connStr);
                oledbAdapter.Fill(myDataSet, "saveddata");
                oledbConn.Close();

                Info = new ArrayList();

                DataRowCollection dra = myDataSet.Tables["saveddata"].Rows;
                foreach (DataRow dr in dra)
                {
                    ti = new TotalInfo();
                    ti.Date = Convert.ToDateTime(dr[0]);
                    ti.totaltime = Convert.ToDateTime(dr[1]);
                    //ti.Date = ti.Date.AddHours(Convert.ToDouble(dr[1].ToString().Remove(dr[1].ToString().IndexOf(":"))));
                    Info.Add(ti);             
                }

         }
    }
}