Advertisement
Guest User

Untitled

a guest
Apr 17th, 2014
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. this.progressTableAdapter.Fill(this.progressGraphDataSet.Progress);
  2. DataSet ds = new System.Data.DataSet();
  3. DataTable dt = new DataTable();
  4. dt.Columns.Add("X");
  5. dt.Columns.Add("Y");
  6.  
  7. string connection = @"Data Source=../../Database1.sdf";
  8. SqlCeConnection cn = new SqlCeConnection(connection);
  9.  
  10. try
  11. {
  12. cn.Open();
  13. }
  14. catch (SqlCeException ex)
  15. {
  16. MessageBox.Show(ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
  17. Application.ExitThread();
  18. }
  19.  
  20. SqlCeDataAdapter adt = new SqlCeDataAdapter("SELECT * FROM Progress WHERE User_ID ='" + ClassGlobal.userID + "' AND Difficulty = 1", cn);
  21. SqlCeCommandBuilder commBuilder = new SqlCeCommandBuilder(adt);
  22.  
  23. adt.MissingSchemaAction = MissingSchemaAction.AddWithKey;
  24. adt.Fill(dt);
  25.  
  26. this.progressChart.DataSource = dt;
  27.  
  28. ds.Tables.Add(dt);
  29. progressChart.DataSource = ds;
  30. progressChart.Series["Score"].ChartType = SeriesChartType.Line;
  31.  
  32. progressChart.Series["Score"].BorderDashStyle = ChartDashStyle.Solid;
  33. progressChart.Series["Score"].BorderWidth = 2;
  34. progressChart.Series["Score"].Color = Color.Blue;
  35.  
  36. progressChart.Series["Score"].MarkerStyle = MarkerStyle.Circle;
  37. progressChart.Series["Score"].MarkerSize = 6;
  38. progressChart.Series["Score"].MarkerColor = Color.Black;
  39.  
  40. progressChart.Series["Score"].XValueMember = "X";
  41. progressChart.Series["Score"].YValueMembers = "Y";
  42.  
  43. progressChart.DataBind();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement