-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMatches.cs
More file actions
158 lines (129 loc) · 5.52 KB
/
Matches.cs
File metadata and controls
158 lines (129 loc) · 5.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace PSL_Project
{
public partial class Matches : Form
{
public Matches()
{
InitializeComponent();
}
public void displayData(String query)
{
string conString = "Data Source=DESKTOP-1ID9T28\\TABISHSQL;Initial Catalog=PSL;Integrated Security=True";
SqlConnection con = new SqlConnection(conString);
con.Open();
string displayQuery = query;
SqlCommand cmd = con.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = displayQuery;
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
dataGridView1.DataSource = dt;
con.Close();
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
if (String.Equals(comboBox1.Text, "All Matches"))
{
string conString = "Data Source=DESKTOP-1ID9T28\\TABISHSQL;Initial Catalog=PSL;Integrated Security=True";
SqlConnection con = new SqlConnection(conString);
con.Open();
string displayQuery = "SELECT * FROM MATCHES";
SqlCommand cmd = con.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = displayQuery;
cmd.ExecuteNonQuery();
displayData(displayQuery);
}
else if (String.Equals(comboBox1.Text, "Match 28"))
{
string conString = "Data Source=DESKTOP-1ID9T28\\TABISHSQL;Initial Catalog=PSL;Integrated Security=True";
SqlConnection con = new SqlConnection(conString);
con.Open();
string displayQuery = "SELECT * FROM MATCH_28";
SqlCommand cmd = con.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = displayQuery;
cmd.ExecuteNonQuery();
displayData(displayQuery);
}
else if (String.Equals(comboBox1.Text, "Match 29"))
{
string conString = "Data Source=DESKTOP-1ID9T28\\TABISHSQL;Initial Catalog=PSL;Integrated Security=True";
SqlConnection con = new SqlConnection(conString);
con.Open();
string displayQuery = "SELECT * FROM MATCH_29";
SqlCommand cmd = con.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = displayQuery;
cmd.ExecuteNonQuery();
displayData(displayQuery);
}
else if (String.Equals(comboBox1.Text, "Match 30"))
{
string conString = "Data Source=DESKTOP-1ID9T28\\TABISHSQL;Initial Catalog=PSL;Integrated Security=True";
SqlConnection con = new SqlConnection(conString);
con.Open();
string displayQuery = "SELECT * FROM MATCH_30";
SqlCommand cmd = con.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = displayQuery;
cmd.ExecuteNonQuery();
displayData(displayQuery);
}
else if (String.Equals(comboBox1.Text, "Eliminator 1"))
{
string conString = "Data Source=DESKTOP-1ID9T28\\TABISHSQL;Initial Catalog=PSL;Integrated Security=True";
SqlConnection con = new SqlConnection(conString);
con.Open();
string displayQuery = "SELECT * FROM Eliminator_1";
SqlCommand cmd = con.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = displayQuery;
cmd.ExecuteNonQuery();
displayData(displayQuery);
}
else if (String.Equals(comboBox1.Text, "Eliminator 2"))
{
string conString = "Data Source=DESKTOP-1ID9T28\\TABISHSQL;Initial Catalog=PSL;Integrated Security=True";
SqlConnection con = new SqlConnection(conString);
con.Open();
string displayQuery = "SELECT * FROM Eliminator_2";
SqlCommand cmd = con.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = displayQuery;
cmd.ExecuteNonQuery();
displayData(displayQuery);
}
else if (String.Equals(comboBox1.Text, "Final"))
{
string conString = "Data Source=DESKTOP-1ID9T28\\TABISHSQL;Initial Catalog=PSL;Integrated Security=True";
SqlConnection con = new SqlConnection(conString);
con.Open();
string displayQuery = "SELECT * FROM FINAL";
SqlCommand cmd = con.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = displayQuery;
cmd.ExecuteNonQuery();
displayData(displayQuery);
}
}
private void button1_Click(object sender, EventArgs e)
{
Home form = new Home();
this.Hide();
form.ShowDialog();
}
}
}