fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. // your code goes here
  8. }
  9.  
  10. private void button3_Click(object sender, EventArgs e)
  11. {
  12. try
  13. {
  14. DataRow dr = nBA_DataSet.Tables["Players"].NewRow();
  15. dr["ORANK"] = 1;
  16. dr["NAME"] = "Michael Jordan";
  17. dr["GP"] = 52;
  18. dr["FGM"] = 18.6;
  19. dr["FGA"] = 25.4;
  20. dr["FTM"] = 6.3;
  21. dr["FTA"] = 8.0;
  22. dr["THREEPTM"] = 5.2;
  23. dr["PTS"] = 38.6;
  24. dr["REB"] = 10.6;
  25. dr["AST"] = 7.6;
  26. dr["ST"] = 4.6;
  27. dr["BLK"] = 3.6;
  28. dr["TO"] = 2.6;
  29. dr["STATUS"] = "in";
  30. nBA_DataSet.Tables["Players"].Rows.Add(dr);
  31. playersTableAdapter.Update(nBA_DataSet);
  32. MessageBox.Show("insert success");
  33. }
  34. catch (InvalidCastException error)
  35. {
  36. MessageBox.Show(error.Message.ToString());
  37. }
  38. }
  39. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(14,17): error CS0246: The type or namespace name `DataRow' could not be found. Are you missing a using directive or an assembly reference?
prog.cs(15,17): error CS0841: A local variable `dr' cannot be used before it is declared
prog.cs(16,17): error CS0841: A local variable `dr' cannot be used before it is declared
prog.cs(17,17): error CS0841: A local variable `dr' cannot be used before it is declared
prog.cs(18,17): error CS0841: A local variable `dr' cannot be used before it is declared
prog.cs(19,17): error CS0841: A local variable `dr' cannot be used before it is declared
prog.cs(20,17): error CS0841: A local variable `dr' cannot be used before it is declared
prog.cs(21,17): error CS0841: A local variable `dr' cannot be used before it is declared
prog.cs(22,17): error CS0841: A local variable `dr' cannot be used before it is declared
prog.cs(23,17): error CS0841: A local variable `dr' cannot be used before it is declared
prog.cs(24,17): error CS0841: A local variable `dr' cannot be used before it is declared
prog.cs(25,17): error CS0841: A local variable `dr' cannot be used before it is declared
prog.cs(26,17): error CS0841: A local variable `dr' cannot be used before it is declared
prog.cs(27,17): error CS0841: A local variable `dr' cannot be used before it is declared
prog.cs(28,17): error CS0841: A local variable `dr' cannot be used before it is declared
prog.cs(29,17): error CS0841: A local variable `dr' cannot be used before it is declared
prog.cs(30,17): error CS0103: The name `nBA_DataSet' does not exist in the current context
prog.cs(31,17): error CS0103: The name `playersTableAdapter' does not exist in the current context
prog.cs(32,17): error CS0103: The name `MessageBox' does not exist in the current context
prog.cs(36,17): error CS0103: The name `MessageBox' does not exist in the current context
Compilation failed: 20 error(s), 0 warnings
stdout
Standard output is empty