Guest User

Untitled

a guest
Jul 15th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using System.Data.SqlClient;
  11. using System.Windows.Forms.DataVisualization.Charting;
  12.  
  13. namespace WindowsFormsApp1
  14. {
  15. public partial class Form1 : Form
  16. {
  17.  
  18.  
  19. public Form1()
  20. {
  21. InitializeComponent();
  22. }
  23.  
  24. private void button1_Click(object sender, EventArgs e)
  25. {
  26. SqlConnection con = new SqlConnection("Data Source=DESKTOP-8GV813C\\SQLEXPRESS01; Initial Catalog=marat; Integrated Security=SSPI;");
  27. con.Open();
  28. SqlCommand cmd = new SqlCommand("select * from marat", con);
  29. SqlDataAdapter sda = new SqlDataAdapter(cmd);
  30. DataSet ds = new DataSet();
  31. chart1.DataSource = ds.Tables["CountryID"];
  32. chart1.Series["Series1"].XValueMember = "ID";
  33. chart1.Series["Series1"].YValueMembers = "ID";
  34. this.chart1.Titles.Add("piwe");
  35. chart1.Series["Series1"].ChartType = SeriesChartType.Pie;
  36.  
  37. //Form2 fm = new Form2();
  38. //fm.Show();
  39. }
  40. }
  41. }
Add Comment
Please, Sign In to add comment