private void uploadResistanceButton_Click(object sender, EventArgs e) { var boardId = textBox2.Text; char groupId = Convert.ToChar(textBox1.Text); /* Grab data from spreadsheet and place in lists */ for (int i = 0; i < 100; i++) { var resistance = Convert.ToSingle(dataGridView2.Rows[i].Cells[0].Value); var res = new EET321_Lab6DataContext(); var data = new Table_Resistance(); data.GroupID = groupId; data.BoardID = boardId; data.DateTime = DateTime.Now; data.Resistance = resistance; res.Table_Resistances.InsertOnSubmit(data); res.SubmitChanges(); //submit changes Thread.Sleep(100); //wait .1 sec } System.Windows.Forms.MessageBox.Show("Upload complete!"); //Message upload complete }
private void uploadResistanceButton_Click(object sender, EventArgs e) { var boardId = textBox2.Text; char groupId = Convert.ToChar(textBox1.Text); /* Grab data from spreadsheet and place in lists */ for (int i = 0; i < 100; i++) { var resistance = Convert.ToSingle(dataGridView2.Rows[i].Cells[0].Value); var res = new EET321_Lab6DataContext(); var data = new Table_Resistance(); data.GroupID = groupId; data.BoardID = boardId; data.DateTime = DateTime.Now; data.Resistance = resistance; res.Table_Resistances.InsertOnSubmit(data); res.SubmitChanges(); //submit changes } System.Windows.Forms.MessageBox.Show("Upload complete!"); }
partial void DeleteTable_Resistance(Table_Resistance instance);
partial void UpdateTable_Resistance(Table_Resistance instance);
partial void InsertTable_Resistance(Table_Resistance instance);