VS 2005 Net 2.0

I'm a student and have been using C# before with VS for class but have yet to use it to make a functional data table.
For the project I'm working on I need a gui where you can upload a csv into a data table, then run an autocalculation that sums and reports the top values by city, which is a field in the csv. Thing is, I'm not really sure where to go with this.

Below is what I have so far. Not sure how close (or far) I am to what I need done; hopefully, I found a forum I can get some help with this stuff.....

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
using System.IO;

namespace WindowsFormsApplication1
public partial class Form1 : Form
public Form1()

private void button1_Click(object sender, EventArgs e)
//OpenFileDialog dialog = new OpenFileDialog();

openFileDialog1.Filter =
"csv files (*.csv)|*.csv|All files (*.*)|*.*";
openFileDialog1.Title = "Select a CSV file";

DataView yes = new DataView();


public void setExcelFileAsDataSourceToDataGridView(string FileName)
OleDbConnection objConn;
OleDbDataAdapter oleDA;
DataSet ds;
//Check Whether file is csv file or not
if (Path.GetExtension(FileName) == ".csv")
//Create a OLEDB connection for Excel file
string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=" + FileName + ";" + "Extended Properties=Excel 8.0;";
objConn = new OleDbConnection(connectionString);
oleDA = new OleDbDataAdapter("select * from [Sheet1$]", objConn);
ds = new DataSet();
//Fill the Data Set
//Set DataSource of DataGridView
dataGridView1.DataSource = ds.Tables[0];
catch (Exception ex)
MessageBox.Show("Please select CSV File");