예제 #1
0
 private async void button1_Click(object sender, EventArgs e)
 {
     using (var db = new AstronomyLogsEntities())
     {
         foreach (AstronomyEntry entry in AstronomyParser.fillSQLEntry(dt))
         {
             db.AstronomyEntries.Add(entry);
         }
         db.SaveChanges();
     }
 }
예제 #2
0
        private void btnOpen_Click(object sender, EventArgs e)
        {
            string selectedFile = "";

            OpenFileDialog fileDialog = new OpenFileDialog();

            fileDialog.Title            = "Open csv file";
            fileDialog.InitialDirectory = @"c:\";
            fileDialog.Filter           = "All files (*.*)|*.*|All files (*.*)|*.*";

            if (fileDialog.ShowDialog() == DialogResult.OK)
            {
                selectedFile = fileDialog.FileName;
            }
            dt = AstronomyParser.readCSV(selectedFile);
            gridView.DataSource = dt;
        }